home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the 3D Game Programming Gurus / gurus.iso / DirectX / dx9sdkcp.exe / SDK (C++) / Include / DShowIDL / axextend.idl < prev    next >
Encoding:
Text File  |  2002-11-12  |  173.7 KB  |  5,106 lines

  1. //------------------------------------------------------------------------------
  2. // File: AXExtend.idl
  3. //
  4. // Desc: Extended streaming interface definitions for the ActiveMovie
  5. //       streaming and synchronization architecture.  Core streaming
  6. //       interfaces are in AXCore.idl, and control interfaces for the
  7. //       type library are in Control.odl.
  8. //
  9. // Copyright (c) 1992 - 2000, Microsoft Corporation.  All rights reserved.
  10. //------------------------------------------------------------------------------
  11.  
  12.  
  13. // include after unknwn.idl, objidl.idl and axcore.idl
  14.  
  15.  
  16. // forward declarations - these are the interfaces declared in this file
  17.  
  18. interface IEnumRegFilters;
  19. interface IFileSourceFilter;
  20. interface IFileSinkFilter;
  21. interface IFileSinkFilter2;
  22. interface IGraphBuilder;
  23. interface ICaptureGraphBuilder;
  24. interface ICaptureGraphBuilder2;
  25. interface IAMCopyCaptureFileProgress;
  26. interface IFilterMapper;
  27. interface IFilterMapper2;
  28. interface IMediaEventSink;
  29. interface IOverlay;
  30. interface IOverlayNotify;
  31. interface IOverlayNotify2;
  32. interface IQualityControl;
  33. interface ISeekingPassThru;
  34. interface IAMStreamConfig;
  35. interface IAMDevMemoryAllocator;
  36. interface IAMDevMemoryControl;
  37. interface IConfigInterleaving;
  38. interface IConfigAviMux;
  39. interface IAMVideoCompression;
  40. interface IAMVfwCaptureDialogs;
  41. interface IAMVfwCompressDialogs;
  42. interface IAMDroppedFrames;
  43. interface IAMAudioInputMixer;
  44. interface IAMBufferNegotiation;
  45. interface IAMAnalogVideoDecoder;
  46. interface IAMVideoProcAmp;
  47. interface IAMAnalogVideoEncoder;
  48. interface IAMCameraControl;
  49. interface IAMCrossbar;
  50. interface IAMTVTuner;
  51. interface IKsPropertySet;
  52. interface IAMPhysicalPinInfo;
  53. interface IAMExtDevice;
  54. interface IAMExtTransport;
  55. interface IAMTimecodeReader;
  56. interface IAMTimecodeGenerator;
  57. interface IAMTimecodeDisplay;
  58. interface IDrawVideoImage;
  59. interface IDecimateVideoImage;
  60. interface IAMVideoDecimationProperties;
  61. interface IAMPushSource;
  62. interface IAMAudioRendererStats;
  63. interface IAMLatency;
  64. interface IAMGraphStreams;
  65. interface IAMOverlayFX;
  66. interface IAMOpenProgress;
  67. interface IMpeg2Demultiplexer ;
  68. interface IMPEG2StreamIdMap ;
  69. interface IEnumStreamIdMap ;
  70. interface IAMClockSlave ;
  71. interface IEncoderAPI;
  72. interface IVideoEncoder;
  73. interface IAMGraphBuilderCallback;
  74.  
  75. //==========================================================================
  76. //==========================================================================
  77. // IEnumRegFilters interface -- enumerates registered filters.
  78. // enumerator interface returned from IFilterMapper::EnumMatchingFilters().
  79. // based on IEnum pseudo-template
  80. //==========================================================================
  81. //==========================================================================
  82.  
  83. typedef struct {
  84.     CLSID Clsid;             // class id of the filter
  85.     LPWSTR Name;             // name of filter
  86. } REGFILTER;
  87.  
  88. [
  89. object,
  90. uuid(56a868a4-0ad4-11ce-b03a-0020af0ba770),
  91. pointer_default(unique)
  92. ]
  93.  
  94. // The point of the mapper is to avoid loading filters.  By looking in the
  95. // registry we can reduce the number of filters which must be loaded and tried.
  96. // This enumerator returns descriptors of filters (including the GUIDs that
  97. // CoCreateInstance can instantiate).  The filters themselves are not loaded.
  98.  
  99. interface IEnumRegFilters : IUnknown {
  100.     import "unknwn.idl";
  101.  
  102.     // The caller must use CoTaskMemFree to free each REGFILTER* returned
  103.     // in the array.
  104.     HRESULT Next
  105.         ( [in]  ULONG cFilters,           // place this many filters...
  106.           [out] REGFILTER ** apRegFilter, // ...in this array of REGFILTER*
  107.           [out] ULONG * pcFetched         // actual count passed returned here
  108.         );
  109.  
  110.     // I can't think why anyone would want to skip, so it's not implemented.
  111.     // (anyone who thinks they know what they would be skipping over is probably
  112.     // missing some piece of the jigsaw). This ALWAYS returns E_NOTIMPL.
  113.  
  114.     HRESULT Skip(
  115.         [in] ULONG cFilters
  116.     );
  117.  
  118.     HRESULT Reset(void);
  119.  
  120.     // No cloning either - also ALWAYS returns E_NOTIMPL.
  121.  
  122.     HRESULT Clone(
  123.         [out] IEnumRegFilters **ppEnum
  124.     );
  125. }
  126.  
  127.  
  128. typedef IEnumRegFilters *PENUMREGFILTERS;
  129.  
  130. //========================================================================
  131. //========================================================================
  132. // abstraction representing the registered information about filters.
  133. // This allows properties of filters to be looked up without loading them.
  134. //========================================================================
  135. //========================================================================
  136.  
  137. [
  138. object,
  139. uuid(56a868a3-0ad4-11ce-b03a-0020af0ba770),
  140. pointer_default(unique)
  141. ]
  142. interface IFilterMapper : IUnknown {
  143.     import "unknwn.idl";
  144.  
  145.     //==========================================================================
  146.     // Registration functions.
  147.     // A filter should be registered before any other use.
  148.     // The registration can be NON_VOLATILE (i.e. permanent, do once ever)
  149.     // or VOLATILE (once per boot of the system).
  150.     // UnregisterFilter (obviously) removes the registration.
  151.     // The action of any of the other calls on unregistered filters is undefined.
  152.     // it will either work or you'll get an error, but I'm not saying which.
  153.     //==========================================================================
  154.  
  155.     // Four predefined values controling the order in which filters are tried
  156.     // for intelligent graph building.  Intermediate values are legal.
  157.     // Any value <=MERIT_DO_NOT_USE will mean that the filter will never
  158.     // be tried by the filtergrah to automatically complete a connection.
  159.  
  160.     enum { MERIT_PREFERRED     = 0x800000,
  161.            MERIT_NORMAL        = 0x600000,
  162.            MERIT_UNLIKELY      = 0x400000,
  163.            MERIT_DO_NOT_USE    = 0x200000,
  164.            MERIT_SW_COMPRESSOR = 0x100000,
  165.            MERIT_HW_COMPRESSOR = 0x100050
  166.          };
  167.  
  168.     // Register a filter
  169.  
  170.     HRESULT RegisterFilter
  171.         ( [in] CLSID   clsid,    // GUID of the filter
  172.           [in] LPCWSTR Name,     // Descriptive name for the filter
  173.           [in] DWORD   dwMerit   // DO_NOT_USE, UNLIKELY, NORMAL or PREFERRED.
  174.         );
  175.  
  176.  
  177.     // Register an identifiable instance of a filter.  This deals with cases
  178.     // such as two similar sound cards which are driven by the same driver,
  179.     // but we want to choose which oif these cards the sound will come out of.
  180.     // This is not needed if there is only one instance of the filter
  181.     // (e.g. there is only one sound card in the machine) or if all instances
  182.     // of the filter are equivalent.
  183.  
  184.     // The filter itself must have already been registered   // ??? Is that true?
  185.     HRESULT RegisterFilterInstance
  186.         ( [in]  CLSID  clsid,      // GUID of the filter
  187.           [in]  LPCWSTR Name,      // Descriptive name of instance.
  188.           [out] CLSID *MRId        // Returned Media Resource Id.  A
  189.                                    // locally unique id for this instance
  190.                                    // of this filter
  191.         );
  192.  
  193.  
  194.     HRESULT RegisterPin
  195.         ( [in] CLSID   Filter,           // GUID of filter
  196.           [in] LPCWSTR Name,             // Name of the pin
  197.           [in] BOOL    bRendered,        // The filter renders this input
  198.           [in] BOOL    bOutput,          // TRUE if this is an Output pin
  199.           [in] BOOL    bZero,            // TRUE if OK for zero instances of pin
  200.                                          // In this case you will have to Create
  201.                                          // a pin to have even one instance
  202.           [in] BOOL    bMany,            // TRUE if OK for many instances of pin
  203.           [in] CLSID   ConnectsToFilter, // Filter it connects to if it has
  204.                                          // subterranean connection, else NULL
  205.           [in] LPCWSTR ConnectsToPin     // Name of pin it connects to
  206.                                          // NULL for output pins
  207.         );
  208.  
  209.     HRESULT RegisterPinType
  210.         ( [in] CLSID   clsFilter,        // GUID of filter
  211.           [in] LPCWSTR strName,          // Descriptive name of the pin
  212.           [in] CLSID   clsMajorType,     // Major type of the data stream
  213.           [in] CLSID   clsSubType        // Sub type of the data stream
  214.         );
  215.  
  216.  
  217.     HRESULT UnregisterFilter
  218.         ( [in] CLSID  Filter             // GUID of filter
  219.         );
  220.  
  221.  
  222.     HRESULT UnregisterFilterInstance
  223.         ( [in] CLSID  MRId               // Media Resource Id of this instance
  224.         );
  225.  
  226.  
  227.     HRESULT UnregisterPin
  228.         ( [in] CLSID   Filter,           // GUID of filter
  229.           [in] LPCWSTR Name              // Name of the pin
  230.         );
  231.  
  232.  
  233.     // Set *ppEnum to be an enumerator for filters matching the requirements.
  234.  
  235.     HRESULT EnumMatchingFilters
  236.        ( [out] IEnumRegFilters **ppEnum  // enumerator returned
  237.        , [in]  DWORD dwMerit             // at least this merit needed
  238.        , [in]  BOOL  bInputNeeded        // need at least one input pin
  239.        , [in]  CLSID clsInMaj            // input major type
  240.        , [in]  CLSID clsInSub            // input sub type
  241.        , [in]  BOOL  bRender             // must the input be rendered?
  242.        , [in]  BOOL  bOututNeeded        // need at least one output pin
  243.        , [in]  CLSID clsOutMaj           // output major type
  244.        , [in]  CLSID clsOutSub           // output sub type
  245.        );
  246.  
  247. }
  248.  
  249. // structure used to identify media types a pin handles. Used for
  250. // registration through IFilterMapper and IFilterMapper2
  251. //
  252. typedef struct
  253. {
  254.     const CLSID * clsMajorType;
  255.     const CLSID * clsMinorType;
  256. } REGPINTYPES;
  257.  
  258. // describes pin for filter registration. Used for registration
  259. // through IFilterMapper and IFilterMapper2
  260. //
  261. typedef struct
  262. {
  263.     LPWSTR           strName;
  264.  
  265.     // The filter renders this input
  266.     BOOL             bRendered;
  267.  
  268.     // This is an Output pin
  269.     BOOL             bOutput;
  270.  
  271.     // OK to have zero instances of pin In this case you will have to
  272.     // Create a pin to have even one instance
  273.     BOOL             bZero;
  274.  
  275.     // OK to create many instance of  pin
  276.     BOOL             bMany;
  277.  
  278.     const CLSID *    clsConnectsToFilter;
  279.     const WCHAR *    strConnectsToPin;
  280.  
  281.     UINT             nMediaTypes;
  282.     const REGPINTYPES * lpMediaType;
  283. } REGFILTERPINS;
  284.  
  285. // mediums (as defined in the Windows NT DDK) for registration with
  286. // IFilterMapper2
  287. //
  288. typedef struct
  289. {
  290.     CLSID clsMedium;
  291.     DWORD dw1;
  292.     DWORD dw2;
  293. } REGPINMEDIUM;
  294.  
  295. // flags for dwFlags in REFILTERPINS2
  296. enum
  297. {
  298.     // OK to have zero instances of pin In this case you will have to
  299.     // Create a pin to have even one instance
  300.     REG_PINFLAG_B_ZERO = 0x1,
  301.  
  302.     // The filter renders this input
  303.     REG_PINFLAG_B_RENDERER = 0x2,
  304.  
  305.     // OK to create many instance of  pin
  306.     REG_PINFLAG_B_MANY = 0x4,
  307.  
  308.     // This is an Output pin
  309.     REG_PINFLAG_B_OUTPUT = 0x8
  310. };
  311.  
  312.  
  313. // describes pin for filter registration through IFilterMapper2
  314. typedef struct
  315. {
  316.     // combination of REG_PINFLAG flags
  317.     DWORD dwFlags;
  318.  
  319.     // number of instances of the pin if known
  320.     UINT             cInstances;
  321.  
  322.     UINT             nMediaTypes;
  323.     [size_is(nMediaTypes)] const REGPINTYPES * lpMediaType;
  324.  
  325.     UINT             nMediums;
  326.     [size_is(nMediums)] const REGPINMEDIUM *lpMedium;
  327.  
  328.     // pin category (for Kernel Streaming pins) as defined in the
  329.     // Windows NT DDK
  330.     const CLSID      *clsPinCategory;
  331.  
  332. } REGFILTERPINS2;
  333.  
  334. // describes filter for registration through IFilterMapper2
  335. typedef struct
  336. {
  337.     DWORD dwVersion;            // 1 or 2
  338.     DWORD dwMerit;
  339.  
  340.     /* unnamed union */
  341.     [switch_is(dwVersion)] [switch_type(DWORD)] union
  342.     {
  343.         [case(1)]
  344.  
  345.             struct
  346.             {
  347.                 ULONG cPins;
  348.                 [size_is(cPins)] const REGFILTERPINS *rgPins;
  349.             };
  350.  
  351.         [case(2)]
  352.  
  353.             struct
  354.             {
  355.                 ULONG cPins2;
  356.                 [size_is(cPins2)] const REGFILTERPINS2 *rgPins2;
  357.             };
  358.  
  359.         [default]
  360.             ;
  361.     } ;
  362.  
  363. } REGFILTER2;
  364.  
  365.  
  366.  
  367. [
  368. object,
  369. uuid(b79bb0b0-33c1-11d1-abe1-00a0c905f375),
  370. pointer_default(unique)
  371. ]
  372. interface IFilterMapper2 : IUnknown {
  373.     import "unknwn.idl";
  374.  
  375.     // create or rename ActiveMovie category
  376.     HRESULT CreateCategory
  377.         ( [in] REFCLSID clsidCategory,
  378.           [in] DWORD dwCategoryMerit,
  379.           [in] LPCWSTR Description
  380.           );
  381.  
  382.     HRESULT UnregisterFilter
  383.         ( [in] const CLSID *pclsidCategory,
  384.           [in] const OLECHAR *szInstance,
  385.           [in] REFCLSID Filter // GUID of filter
  386.         );
  387.  
  388.     // Register a filter, pins, and media types under a category.
  389.     HRESULT RegisterFilter
  390.         ( [in] REFCLSID clsidFilter,     // GUID of the filter
  391.           [in] LPCWSTR Name,             // Descriptive name for the filter
  392.  
  393.           // ppMoniker can be null. or *ppMoniker can contain the
  394.           // moniker where this filter data will be written;
  395.           // *ppMoniker will be set to null on return. or *ppMoniker
  396.           // can be null in which case the moniker will be returned
  397.           // with refcount.
  398.           [in, out] IMoniker **ppMoniker,
  399.  
  400.           // can be null
  401.           [in] const CLSID *pclsidCategory,
  402.  
  403.           // cannot be null
  404.           [in] const OLECHAR *szInstance,
  405.  
  406.           // rest of filter and pin registration
  407.           [in] const REGFILTER2 *prf2
  408.         );
  409.  
  410.     // Set *ppEnum to be an enumerator for filters matching the
  411.     // requirements.
  412.     HRESULT EnumMatchingFilters
  413.        ( [out] IEnumMoniker **ppEnum           // enumerator returned
  414.        , [in]  DWORD dwFlags                   // 0
  415.        , [in]  BOOL bExactMatch                // don't match wildcards
  416.        , [in]  DWORD dwMerit                   // at least this merit needed
  417.        , [in]  BOOL  bInputNeeded              // need at least one input pin
  418.        , [in]  DWORD cInputTypes               // Number of input types to match
  419.                                                // Any match is OK
  420.        , [size_is(cInputTypes*2)]  const GUID *pInputTypes // input major+subtype pair array
  421.        , [in]  const REGPINMEDIUM *pMedIn      // input medium
  422.        , [in]  const CLSID *pPinCategoryIn     // input pin category
  423.        , [in]  BOOL  bRender                   // must the input be rendered?
  424.        , [in]  BOOL  bOutputNeeded             // need at least one output pin
  425.        , [in]  DWORD cOutputTypes              // Number of output types to match
  426.                                                // Any match is OK
  427.        , [size_is(cOutputTypes*2)]  const GUID *pOutputTypes // output major+subtype pair array
  428.        , [in]  const REGPINMEDIUM *pMedOut     // output medium
  429.        , [in]  const CLSID *pPinCategoryOut    // output pin category
  430.        );
  431. }
  432.  
  433. [
  434. object,
  435. uuid(b79bb0b1-33c1-11d1-abe1-00a0c905f375),
  436. pointer_default(unique)
  437. ]
  438. interface IFilterMapper3 : IFilterMapper2 {
  439.     // new interface to allow creating filters using the mapper's devenum instance
  440.     // primarily needed for out-of-proc access to a graph
  441.     HRESULT GetICreateDevEnum( [out] ICreateDevEnum **ppEnum );
  442. }
  443.  
  444. //========================================================================
  445. //========================================================================
  446. // Defines IQualityControl interface
  447. //
  448. // Defines quality messages and allows a quality manager to install itself
  449. // as the sink for quality messages.
  450. //========================================================================
  451. //========================================================================
  452.  
  453. typedef enum tagQualityMessageType {
  454.     Famine,
  455.     Flood
  456. } QualityMessageType;
  457.  
  458. typedef struct tagQuality {
  459.     QualityMessageType Type;
  460.     long                Proportion;   // milli-units.  1000 = no change
  461.                             // for Flood:
  462.                             // What proportion of the media samples currently
  463.                             // coming through are required in the future.
  464.                             // 800 means please drop another 20%
  465.                             // For Famine:
  466.                             // How much to "keep in" e.g. 800 means send me
  467.                             // 20% less e.g. by dropping 20% of the samples.
  468.                             // 1100 would mean "I'm coping, send me more".
  469.     REFERENCE_TIME       Late;
  470.                             // How much you need to catch up by
  471.     REFERENCE_TIME       TimeStamp;
  472.                             // The stream time when this was generated (probably
  473.                             // corresponds to the start time on some sample).
  474. } Quality;
  475.  
  476. typedef IQualityControl *PQUALITYCONTROL;
  477.  
  478.  
  479. [
  480. object,
  481. uuid(56a868a5-0ad4-11ce-b03a-0020af0ba770),
  482. pointer_default(unique)
  483. ]
  484. interface IQualityControl : IUnknown {
  485.  
  486.     // Notify the recipient that a quality change is requested.
  487.     // pSelf is the IBaseFilter* of the sender.
  488.     // this is sent from a filter
  489.     // to (the quality manager or) an upstream peer.
  490.     HRESULT Notify
  491.         ( [in] IBaseFilter * pSelf,
  492.           [in] Quality q
  493.         );
  494.  
  495.     // Notify the recipient that future quality messages are to be sent
  496.     // to iqc.  If piqc is NULL then quality messages are to default back to
  497.     // the upstream peer.
  498.     // This is sent from the quality manager to a filter.
  499.     // The recipient should hold piqc as a WEAK reference,
  500.     // i.e. do not AddRef it, do not Release it.
  501.     HRESULT SetSink
  502.         ( [in] IQualityControl * piqc
  503.         );
  504. }
  505.  
  506. //=====================================================================
  507. //=====================================================================
  508. // Definitions required for overlay transport
  509. //=====================================================================
  510. //=====================================================================
  511.  
  512.  
  513. // Used to communicate the colour that the IOverlay client wants the window
  514. // painted in so that it can draw directly to the correct clipping region
  515. // A colour key can be described in two alternate ways, the first is by a
  516. // range of one or more (system) palette indices. The second is by defining
  517. // a colour cube with two RGB values, any of which would be acceptable.
  518. //
  519. // The CK values are consistent with GDI PALETTEINDEX and PALETTERGB macros
  520.  
  521.  
  522. enum { CK_NOCOLORKEY = 0x0,     // No color key is required
  523.        CK_INDEX       = 0x1,    // Index into the current system palette
  524.        CK_RGB         = 0x2 };  // Color key is an RGB value (or range)
  525.  
  526. typedef struct tagCOLORKEY {
  527.  
  528.     DWORD    KeyType;           // Explains meaning of the structure
  529.     DWORD    PaletteIndex;      // Palette index if available
  530.     COLORREF LowColorValue;     // Low colour space RGB value
  531.     COLORREF HighColorValue;    // Defines the high RGB value
  532.  
  533. } COLORKEY;
  534.  
  535. // When a filter sets up an advise link it can ask that only certain types
  536. // of notifications be sent, for example just palette changes. While this
  537. // doesn't mean that the other notification call backs won't ever be called
  538. // the IOverlay implementation may use this as an efficiency optimisation
  539.  
  540. enum { ADVISE_NONE = 0x0,               // No notifications required
  541.        ADVISE_CLIPPING = 0x1,           // Synchronous clip information
  542.        ADVISE_PALETTE = 0x2,            // Palette change notifications
  543.        ADVISE_COLORKEY = 0x4,           // Called when colour key changes
  544.        ADVISE_POSITION = 0x8,           // Likewise when window moves etc
  545.        ADVISE_DISPLAY_CHANGE = 0x10     // Called on WM_DISPLAYCHANGE
  546.      };
  547.  
  548. const DWORD ADVISE_ALL = ADVISE_CLIPPING |
  549.                          ADVISE_PALETTE |
  550.                          ADVISE_COLORKEY |
  551.                          ADVISE_POSITION;
  552.  
  553. const DWORD ADVISE_ALL2 = ADVISE_ALL |
  554.                           ADVISE_DISPLAY_CHANGE;
  555.  
  556. // This isn't defined when you run IDL
  557.  
  558. cpp_quote("#ifndef _WINGDI_")
  559.  
  560. typedef struct _RGNDATAHEADER {
  561.     DWORD dwSize;
  562.     DWORD iType;
  563.     DWORD nCount;
  564.     DWORD nRgnSize;
  565.     RECT  rcBound;
  566. } RGNDATAHEADER;
  567.  
  568. typedef struct _RGNDATA {
  569.     RGNDATAHEADER rdh;
  570.     char Buffer[1];
  571. } RGNDATA;
  572.  
  573. cpp_quote("#endif")
  574.  
  575.  
  576. //=====================================================================
  577. //=====================================================================
  578. // Defines IOverlayNotify interface
  579. //
  580. // This interface gives asynchronous notifications of changes to the
  581. // rendering window - such as changes to the exposed window area
  582. //=====================================================================
  583. //=====================================================================
  584.  
  585. [
  586. object,
  587. local,
  588. uuid(56a868a0-0ad4-11ce-b03a-0020af0ba770),
  589. pointer_default(unique)
  590. ]
  591. interface IOverlayNotify : IUnknown {
  592.  
  593.     // IOverlayNotify methods
  594.  
  595.     // This notifies the filter of palette changes, the filter should copy
  596.     // the array of RGBQUADs if it needs to use them after returning. This
  597.     // is not called when the palette is actually changed in the display
  598.     // but at a short time after (in sync with WM_PALETTECHANGED messages)
  599.  
  600.     HRESULT OnPaletteChange(
  601.         [in] DWORD dwColors,                // Number of colours present
  602.         [in] const PALETTEENTRY *pPalette); // Array of palette colours
  603.  
  604.     // This provides synchronous clip changes so that the client is called
  605.     // before the window is moved to freeze the video, and then when the
  606.     // window has stabilised it is called again to start playback again.
  607.     // If the window rect is all zero then the window is invisible, the
  608.     // filter must take a copy of the information if it wants to keep it
  609.  
  610.     HRESULT OnClipChange(
  611.         [in] const RECT *pSourceRect,       // Region of video to use
  612.         [in] const RECT *pDestinationRect,  // Where video goes
  613.         [in] const RGNDATA *pRgnData);      // Defines clipping information
  614.  
  615.     HRESULT OnColorKeyChange([in] const COLORKEY *pColorKey);
  616.  
  617.     // The calls to OnClipChange happen in sync with the window. So it is
  618.     // called with an empty clip list before the window moves to freeze
  619.     // the video, and then when the window has stabilised it is called
  620.     // again with the new clip list. The OnPositionChange callback is for
  621.     // overlay cards that don't want the expense of synchronous clipping
  622.     // updates and just want to know when the source or destination video
  623.     // positions change. They will NOT be called in sync with the window
  624.     // but at some point after the window has changed (basicly in time
  625.     // with WM_SIZE etc messages received). This is therefore suitable
  626.     // for overlay cards that don't inlay their data to the frame buffer
  627.     // NOTE the destination is NOT clipped to the visible display area
  628.  
  629.     HRESULT OnPositionChange([in] const RECT *pSourceRect,
  630.                              [in] const RECT *pDestinationRect);
  631. }
  632.  
  633. typedef IOverlayNotify *POVERLAYNOTIFY;
  634.  
  635.  
  636. //=====================================================================
  637. //=====================================================================
  638. // Defines IOverlayNotify2 interface
  639. //
  640. // This interface gives asynchronous notifications of changes to the
  641. // rendering window - such as changes to the exposed window area
  642. // This is optionally supported by the advise sink for the purposes
  643. // of accepting OnDisplayChange notification.
  644. //=====================================================================
  645. //=====================================================================
  646.  
  647. cpp_quote("#if !defined(HMONITOR_DECLARED) && !defined(HMONITOR) && (WINVER < 0x0500)")
  648. cpp_quote("#define HMONITOR_DECLARED")
  649. cpp_quote("#if 0")
  650. typedef HANDLE HMONITOR;
  651. cpp_quote("#endif")
  652. cpp_quote("DECLARE_HANDLE(HMONITOR);")
  653. cpp_quote("#endif")
  654.  
  655. [
  656. object,
  657. local,
  658. uuid(680EFA10-D535-11D1-87C8-00A0C9223196),
  659. pointer_default(unique)
  660. ]
  661. interface IOverlayNotify2 : IOverlayNotify {
  662.  
  663.     // IOverlayNotify2 methods
  664.  
  665.     HRESULT OnDisplayChange(    // ADVISE_DISPLAY_CHANGE
  666.         HMONITOR hMonitor);
  667. }
  668.  
  669. typedef IOverlayNotify2 *POVERLAYNOTIFY2;
  670.  
  671.  
  672. //=====================================================================
  673. //=====================================================================
  674. // Defines IOverlay interface
  675. //
  676. // This interface provides information so that a filter can write direct to
  677. // the frame buffer while placing the video in the correct window position
  678. //=====================================================================
  679. //=====================================================================
  680.  
  681. [
  682. object,
  683. local,
  684. uuid(56a868a1-0ad4-11ce-b03a-0020af0ba770),
  685. pointer_default(unique)
  686. ]
  687. interface IOverlay : IUnknown {
  688.  
  689.     // IOverlay methods
  690.  
  691.     HRESULT GetPalette(
  692.         [out] DWORD *pdwColors,              // Number of colours present
  693.         [out] PALETTEENTRY **ppPalette);     // Where to put palette data
  694.  
  695.     HRESULT SetPalette(
  696.         [in] DWORD dwColors,                 // Number of colours present
  697.         [in] PALETTEENTRY *pPalette);        // Colours to use for palette
  698.  
  699.     // If you change the colour key through SetColorKey then all the advise
  700.     // links will receive an OnColorKeyChange callback with the new colour
  701.  
  702.     HRESULT GetDefaultColorKey([out] COLORKEY *pColorKey);
  703.     HRESULT GetColorKey([out] COLORKEY *pColorKey);
  704.     HRESULT SetColorKey([in,out] COLORKEY *pColorKey);
  705.     HRESULT GetWindowHandle([out] HWND *pHwnd);
  706.  
  707.     // The IOverlay implementation allocates the memory for the clipping
  708.     // rectangles as it can be variable in length. The filter calling
  709.     // this method should free the memory when it is finished with it
  710.  
  711.     HRESULT GetClipList([out] RECT *pSourceRect,
  712.                         [out] RECT *pDestinationRect,
  713.                         [out] RGNDATA **ppRgnData);
  714.  
  715.     // Returns the current video source and destination
  716.  
  717.     HRESULT GetVideoPosition([out] RECT *pSourceRect,
  718.                              [out] RECT *pDestinationRect);
  719.  
  720.     HRESULT Advise(
  721.         [in] IOverlayNotify *pOverlayNotify, // Notification interface
  722.         [in] DWORD dwInterests);             // Callbacks interested in
  723.  
  724.     HRESULT Unadvise();                      // Stop the callbacks now
  725. }
  726.  
  727. typedef IOverlay *POVERLAY;
  728.  
  729.  
  730. //=====================================================================
  731. //=====================================================================
  732. // control related interfaces (others are defined in control.odl)
  733. //=====================================================================
  734. //=====================================================================
  735.  
  736.  
  737. //=====================================================================
  738. //=====================================================================
  739. // Defines IMediaEventSink interface
  740. //
  741. // Exposed by filtergraph. Called by filters to notify events. Will be
  742. // passed on to application by the IMediaControl event methods.
  743. //=====================================================================
  744. //=====================================================================
  745.  
  746. [
  747.         object,
  748.         uuid(56a868a2-0ad4-11ce-b03a-0020af0ba770),
  749.         pointer_default(unique)
  750. ]
  751. interface IMediaEventSink : IUnknown {
  752.  
  753.     // notify an event. will be queued, but not delivered to
  754.     // the application on this thread.
  755.     HRESULT Notify(
  756.         [in] long EventCode,
  757.         [in] LONG_PTR EventParam1,
  758.         [in] LONG_PTR EventParam2
  759.     );
  760. }
  761.  
  762. typedef IMediaEventSink *PMEDIAEVENTSINK;
  763.  
  764. //=====================================================================
  765. //=====================================================================
  766. // Defines IFileSourceFilter interface
  767. //
  768. // Exposed by source filters to set the file name and media type.
  769. //=====================================================================
  770. //=====================================================================
  771.  
  772. [
  773.         object,
  774.         uuid(56a868a6-0ad4-11ce-b03a-0020af0ba770),
  775.         pointer_default(unique)
  776. ]
  777. interface IFileSourceFilter : IUnknown {
  778.  
  779.     // Load a file and assign it the given media type
  780.     HRESULT Load(
  781.         [in] LPCOLESTR pszFileName,     // Pointer to absolute path of file to open
  782.         [in, unique] const AM_MEDIA_TYPE *pmt   // Media type of file - can be NULL
  783.     );
  784.     // Get the currently loaded file name
  785.     HRESULT GetCurFile(
  786.         [out] LPOLESTR *ppszFileName,   // Pointer to the path for the current file
  787.         [out] AM_MEDIA_TYPE *pmt        // Pointer to the media type
  788.     );
  789. }
  790.  
  791. typedef IFileSourceFilter *PFILTERFILESOURCE;
  792.  
  793. //=====================================================================
  794. //=====================================================================
  795. // Defines IFileSinkFilter interface
  796. //
  797. // Exposed by renderers to set the output file name.
  798. //=====================================================================
  799. //=====================================================================
  800.  
  801. [
  802.         object,
  803.         uuid(a2104830-7c70-11cf-8bce-00aa00a3f1a6),
  804.         pointer_default(unique)
  805. ]
  806. interface IFileSinkFilter : IUnknown {
  807.  
  808.     // Output to this file. default is to open the existing file
  809.     HRESULT SetFileName(
  810.         [in] LPCOLESTR pszFileName,     // Pointer to absolute path of output file
  811.         [in, unique] const AM_MEDIA_TYPE *pmt   // Media type of file - can be NULL
  812.     );
  813.     // Get the current file name
  814.     HRESULT GetCurFile(
  815.         [out] LPOLESTR *ppszFileName,   // Pointer to the path for the current file
  816.         [out] AM_MEDIA_TYPE *pmt        // Pointer to the media type
  817.     );
  818. }
  819.  
  820. typedef IFileSinkFilter *PFILTERFILESINK;
  821.  
  822. [
  823.         object,
  824.         uuid(00855B90-CE1B-11d0-BD4F-00A0C911CE86),
  825.         pointer_default(unique)
  826. ]
  827. interface IFileSinkFilter2 : IFileSinkFilter {
  828.  
  829.     HRESULT SetMode(
  830.         [in] DWORD dwFlags              // AM_FILESINK_FLAGS
  831.     );
  832.  
  833.     HRESULT GetMode(
  834.         [out] DWORD *pdwFlags           // AM_FILESINK_FLAGS
  835.     );
  836. }
  837.  
  838. typedef IFileSinkFilter2 *PFILESINKFILTER2;
  839.  
  840. typedef enum {
  841.  
  842.     // create a new file
  843.     AM_FILE_OVERWRITE = 0x00000001,
  844.  
  845. } AM_FILESINK_FLAGS;
  846.  
  847.  
  848. //
  849. // Intelligent connectivity for filters - an interface supported by
  850. // filter graphs (since it is an extension to IFilterGraph) that supports
  851. // building of graphs by automatic selection and connection of appropriate
  852. // filters
  853.  
  854. [
  855.     object,
  856.     uuid(56a868a9-0ad4-11ce-b03a-0020af0ba770),
  857.     pointer_default(unique)
  858. ]
  859. interface IGraphBuilder : IFilterGraph {
  860.     // Connect these two pins directly or indirectly, using transform filters
  861.     // if necessary.
  862.  
  863.     HRESULT Connect
  864.         ( [in] IPin * ppinOut,    // the output pin
  865.           [in] IPin * ppinIn      // the input pin
  866.         );
  867.  
  868.  
  869.     // Connect this output pin directly or indirectly, using transform filters
  870.     // if necessary to something that will render it.
  871.  
  872.     HRESULT Render
  873.         ( [in] IPin * ppinOut     // the output pin
  874.         );
  875.  
  876.  
  877.     // Build a filter graph that will render this file using this play list.
  878.     // If lpwstrPlayList is NULL then it will use the default play list
  879.     // which will typically render the whole file.
  880.  
  881.     HRESULT RenderFile
  882.         ( [in] LPCWSTR lpcwstrFile,
  883.           [in, unique] LPCWSTR lpcwstrPlayList
  884.         );
  885.  
  886.  
  887.     // Add to the filter graph a source filter for this file.  This would
  888.     // be the same source filter that would be added by calling Render.
  889.     // This call gives you more control over building
  890.     // the rest of the graph, e.g. AddFilter(<a renderer of your choice>)
  891.     // and then Connect the two.
  892.     // The IBaseFilter* interface exposed by the source filter is returned
  893.     // in ppFilter, addrefed already for you
  894.     // The filter will be known by the name lpcwstrFIlterName
  895.     // nn this filter graph,
  896.     HRESULT AddSourceFilter
  897.         ( [in]      LPCWSTR lpcwstrFileName,
  898.           [in, unique]      LPCWSTR lpcwstrFilterName,
  899.           [out]     IBaseFilter* *ppFilter
  900.         );
  901.  
  902.  
  903.     // If this call is made then trace information will be written to the
  904.     // file showing the actions taken in attempting to perform an operation.
  905.     HRESULT SetLogFile
  906.         ( [in]      DWORD_PTR hFile  // open file handle e.g. from CreateFile
  907.         );
  908.  
  909.  
  910.     // Request that the graph builder should return as soon as possible from
  911.     // its current task.
  912.     // Note that it is possible fot the following to occur in the following
  913.     // sequence:
  914.     //     Operation begins; Abort is requested; Operation completes normally.
  915.     // This would be normal whenever the quickest way to finish an operation
  916.     // was to simply continue to the end.
  917.     HRESULT Abort();
  918.  
  919.     // Return S_OK if the curent operation is to continue,
  920.     // return S_FALSE if the current operation is to be aborted.
  921.     // This method can be called as a callback from a filter which is doing
  922.     // some operation at the request of the graph.
  923.     HRESULT ShouldOperationContinue();
  924.  
  925. }
  926.  
  927.  
  928. //
  929. // New capture graph builder
  930.  
  931. [
  932.     object,
  933.     uuid(bf87b6e0-8c27-11d0-b3f0-00aa003761c5),
  934.     pointer_default(unique)
  935. ]
  936. interface ICaptureGraphBuilder : IUnknown {
  937.  
  938.     // Use this filtergraph
  939.     HRESULT SetFiltergraph(
  940.     [in] IGraphBuilder *pfg);
  941.  
  942.     // what filtergraph are you using?
  943.     // *ppfg->Release() when you're done with it
  944.     HRESULT GetFiltergraph(
  945.     [out] IGraphBuilder **ppfg);
  946.  
  947.     // creates a rendering section in the filtergraph consisting of a MUX
  948.     // of some filetype, and a file writer (and connects them together)
  949.     // *ppf->Release() when you're done with it
  950.     // *ppSink->Release() when you're done with it
  951.     HRESULT SetOutputFileName(
  952.     [in] const GUID *pType,    // type of file to write, eg. MEDIASUBTYPE_Avi
  953.     [in] LPCOLESTR lpstrFile,    // filename given to file writer
  954.     [out] IBaseFilter **ppf,    // returns pointer to the MUX
  955.         [out] IFileSinkFilter **ppSink);// queried from file writer
  956.  
  957.     // Looks for an interface on the filter and on the output pin of the given
  958.     // category.  (Categories: CAPTURE/PREVIEW/VIDEOPORT/VBI etc. or
  959.     // NULL for "don't care".
  960.     // It will also look upstream and downstream of
  961.     // the pin for the interface, to find interfaces on renderers, MUXES, TV
  962.     // Tuners, etc.
  963.     // Call *ppint->Release() when you're done with it
  964.     [local] HRESULT FindInterface(
  965.     [in, unique] const GUID *pCategory,    // can be NULL for all pins
  966.     [in] IBaseFilter *pf,
  967.     [in] REFIID riid,
  968.     [out] void **ppint);
  969.     [call_as(FindInterface)] HRESULT RemoteFindInterface(
  970.     [in, unique] const GUID *pCategory,    // can be NULL for all pins
  971.     [in] IBaseFilter *pf,
  972.     [in] REFIID riid,
  973.     [out] IUnknown **ppint);
  974.  
  975.     // Connects the pin of the given category of the source filter to the
  976.     // rendering filter, optionally through another filter (compressor?)
  977.     // For a non-NULL category, it will instantiate and connect additional
  978.     // required filters upstream too, like TV Tuners and Crossbars.
  979.     // If there is only one output pin on the source, use a NULL
  980.     // category.  You can also have pSource be a pin
  981.     HRESULT RenderStream(
  982.     [in] const GUID *pCategory,    // can be NULL if only one output pin
  983.     [in] IUnknown *pSource,        // filter or pin
  984.     [in] IBaseFilter *pfCompressor,
  985.     [in] IBaseFilter *pfRenderer);    // can be NULL
  986.  
  987.     // Sends IAMStreamControl messages to the pin of the desired category, eg.
  988.     // "capture" or "preview"
  989.     // REFERENCE_TIME=NULL means NOW
  990.     // REFERENCE_TIME=MAX_TIME means never, or cancel previous request
  991.     // NULL controls all capture filters in the graph - you will get one
  992.     //     notification for each filter with a pin of that category found
  993.     // returns S_FALSE if stop will be signalled before last sample is
  994.     //     rendered.
  995.     // return a FAILURE code if the filter does not support IAMStreamControl
  996.     HRESULT ControlStream(
  997.     [in] const GUID *pCategory,
  998.     [in] IBaseFilter *pFilter,
  999.     [in] REFERENCE_TIME *pstart,
  1000.     [in] REFERENCE_TIME *pstop,
  1001.     [in] WORD wStartCookie,        // high word reserved
  1002.     [in] WORD wStopCookie);        // high word reserved
  1003.  
  1004.     // creates a pre-allocated file of a given size in bytes
  1005.     HRESULT AllocCapFile(
  1006.     [in] LPCOLESTR lpstr,
  1007.     [in] DWORDLONG dwlSize);
  1008.  
  1009.     // Copies the valid file data out of the old, possibly huge old capture
  1010.     //   file into a shorter new file.
  1011.     // Return S_FALSE from your progress function to abort capture, S_OK to
  1012.     //   continue
  1013.     HRESULT CopyCaptureFile(
  1014.     [in] LPOLESTR lpwstrOld,
  1015.     [in] LPOLESTR lpwstrNew,
  1016.     [in] int fAllowEscAbort,    // pressing ESC will abort?
  1017.     [in] IAMCopyCaptureFileProgress *pCallback);    // implement this to
  1018.                             // get progress
  1019. }
  1020.  
  1021.  
  1022. //
  1023. // Capture graph builder "CopyCapturedFile" progress callback
  1024.  
  1025. [
  1026.     object,
  1027.     uuid(670d1d20-a068-11d0-b3f0-00aa003761c5),
  1028.     pointer_default(unique)
  1029. ]
  1030. interface IAMCopyCaptureFileProgress : IUnknown {
  1031.  
  1032.     // If you support this interface somewhere, this function will be called
  1033.     // periodically while ICaptureGraphBuilder::CopyCaptureFile is executing
  1034.     // to let you know the progress
  1035.     //
  1036.     // Return S_OK from this function to continue.  Return S_FALSE to abort the
  1037.     // copy
  1038.     HRESULT Progress(
  1039.     [in] int iProgress);        // a number between 0 and 100 (%)
  1040. }
  1041.  
  1042.  
  1043. //
  1044. // Capture graph builder that can deal with a single filter having more than
  1045. // one pin of each category... some new devices can capture both audio and
  1046. // video, for example
  1047. //
  1048.  
  1049. [
  1050.     object,
  1051.     uuid(93E5A4E0-2D50-11d2-ABFA-00A0C9C6E38D),
  1052.     pointer_default(unique)
  1053. ]
  1054. interface ICaptureGraphBuilder2 : IUnknown {
  1055.  
  1056.     // Use this filtergraph
  1057.     HRESULT SetFiltergraph(
  1058.     [in] IGraphBuilder *pfg);
  1059.  
  1060.     // what filtergraph are you using?
  1061.     // *ppfg->Release() when you're done with it
  1062.     HRESULT GetFiltergraph(
  1063.     [out] IGraphBuilder **ppfg);
  1064.  
  1065.     // creates a rendering section in the filtergraph consisting of a MUX
  1066.     // of some filetype, and a file writer (and connects them together)
  1067.     // *ppf->Release() when you're done with it
  1068.     // *ppSink->Release() when you're done with it
  1069.     HRESULT SetOutputFileName(
  1070.     [in] const GUID *pType,        // GUID of MUX filter to use
  1071.     [in] LPCOLESTR lpstrFile,    // filename given to file writer
  1072.     [out] IBaseFilter **ppf,    // returns pointer to the MUX
  1073.         [out] IFileSinkFilter **ppSink);// queried from file writer
  1074.  
  1075.     // Looks for an interface on the filter and on the output pin of the given
  1076.     // category and type.  (Categories: CAPTURE/PREVIEW/VIDEOPORT/VBI etc. or
  1077.     // NULL for "don't care".  Type:  MAJORTYPE_Video/Audio etc or NULL)
  1078.     // !!! Will some filters have >1 capture pin?  ie RGB and MPEG?
  1079.     // It will also look upstream and downstream of
  1080.     // the pin for the interface, to find interfaces on renderers, MUXES, TV
  1081.     // Tuners, etc.
  1082.     // Call *ppint->Release() when you're done with it
  1083.     [local] HRESULT FindInterface(
  1084.     [in] const GUID *pCategory,    // can be NULL for all pins
  1085.     [in] const GUID *pType,        // Audio/Video/??? or NULL (don't care)
  1086.     [in] IBaseFilter *pf,
  1087.     [in] REFIID riid,
  1088.     [out] void **ppint);
  1089.     [call_as(FindInterface)] HRESULT RemoteFindInterface(
  1090.     [in] const GUID *pCategory,    // can be NULL for all pins
  1091.     [in] const GUID *pType,        // Audio/Video/??? or NULL (don't care)
  1092.     [in] IBaseFilter *pf,
  1093.     [in] REFIID riid,
  1094.     [out] IUnknown **ppint);
  1095.  
  1096.     // Connects the pin of the given category and type of the source filter to
  1097.     // the rendering filter, optionally through another filter (compressor?)
  1098.     // (Type is a Majortype, like Video or Audio)
  1099.     // For a non-NULL category, it will instantiate and connect additional
  1100.     // required filters upstream too, like TV Tuners and Crossbars.
  1101.     // If there is only one output pin on the source, use a NULL category
  1102.     // and type.  You can also have pSource be a pin
  1103.     HRESULT RenderStream(
  1104.     [in] const GUID *pCategory,    // can be NULL if only one output pin
  1105.     [in] const GUID *pType,        // Major type (Video/Audio/etc)
  1106.     [in] IUnknown *pSource,        // filter or pin
  1107.     [in] IBaseFilter *pfCompressor,
  1108.     [in] IBaseFilter *pfRenderer);    // can be NULL
  1109.  
  1110.     // Sends IAMStreamControl messages to the pin of the desired category,
  1111.     // (eg. "capture" or "preview") and of the desired type (eg. VIDEO or AUDIO)
  1112.     // A category MUST be given.  If a filter is given, a type must be too.
  1113.     // REFERENCE_TIME=NULL means NOW
  1114.     // REFERENCE_TIME=MAX_TIME means never, or cancel previous request
  1115.     // NULL controls all capture filters in the graph - you will get one
  1116.     //     notification for each filter with a pin of that category found
  1117.     // returns S_FALSE if stop will be signalled before last sample is
  1118.     //     rendered.
  1119.     // return a FAILURE code if the filter does not support IAMStreamControl
  1120.     HRESULT ControlStream(
  1121.     [in] const GUID *pCategory,
  1122.     [in] const GUID *pType,        // Major type (Video/Audio/etc)
  1123.     [in] IBaseFilter *pFilter,
  1124.     [in] REFERENCE_TIME *pstart,
  1125.     [in] REFERENCE_TIME *pstop,
  1126.     [in] WORD wStartCookie,        // high word reserved
  1127.     [in] WORD wStopCookie);        // high word reserved
  1128.  
  1129.     // creates a pre-allocated file of a given size in bytes
  1130.     HRESULT AllocCapFile(
  1131.     [in] LPCOLESTR lpstr,
  1132.     [in] DWORDLONG dwlSize);
  1133.  
  1134.     // Copies the valid file data out of the old, possibly huge old capture
  1135.     //   file into a shorter new file.
  1136.     // Return S_FALSE from your progress function to abort capture, S_OK to
  1137.     //   continue
  1138.     HRESULT CopyCaptureFile(
  1139.     [in] LPOLESTR lpwstrOld,
  1140.     [in] LPOLESTR lpwstrNew,
  1141.     [in] int fAllowEscAbort,    // pressing ESC will abort?
  1142.     [in] IAMCopyCaptureFileProgress *pCallback);    // implement this to
  1143.                             // get progress
  1144.     // Helper fn to find a certain pin on a filter.
  1145.     HRESULT FindPin(
  1146.     [in] IUnknown *pSource,
  1147.     [in] PIN_DIRECTION pindir,    // input or output?
  1148.     [in] const GUID *pCategory,    // what category? (or NULL)
  1149.     [in] const GUID *pType,        // what Major type (or NULL)
  1150.     [in] BOOL fUnconnected,        // must it be unconnected?
  1151.     [in] int num,            // which pin matching this? (0 based)
  1152.     [out] IPin **ppPin);
  1153. }
  1154.  
  1155. enum _AM_RENSDEREXFLAGS {
  1156.     AM_RENDEREX_RENDERTOEXISTINGRENDERERS = 0x01 // Dont add any renderers
  1157. };
  1158.  
  1159. //
  1160. // IFilterGraph2
  1161. //
  1162. // New methods on for IFilterGraph and IGraphBuilder will have to go here.
  1163. //
  1164.  
  1165. [
  1166.     object,
  1167.     uuid(36b73882-c2c8-11cf-8b46-00805f6cef60),
  1168.     pointer_default(unique)
  1169. ]
  1170. interface IFilterGraph2: IGraphBuilder {
  1171.  
  1172.     // Add a Moniker source moniker
  1173.     HRESULT AddSourceFilterForMoniker(
  1174.           [in] IMoniker *pMoniker,
  1175.           [in] IBindCtx *pCtx,
  1176.           [in, unique] LPCWSTR lpcwstrFilterName,
  1177.           [out] IBaseFilter **ppFilter
  1178.     );
  1179.  
  1180.     // Specify the type for a reconnect
  1181.     // This is better than Reconnect as sometime the parties to a
  1182.     // reconnection can't remember what type they'd agreed (!)
  1183.     HRESULT ReconnectEx
  1184.         ( [in] IPin * ppin,             // the pin to disconnect and reconnect
  1185.           [in, unique] const AM_MEDIA_TYPE *pmt // the type to reconnect with - can be NULL
  1186.         );
  1187.  
  1188.     // Render a pin without adding any new renderers
  1189.     HRESULT RenderEx( [in] IPin *pPinOut,         // Pin to render
  1190.                       [in] DWORD dwFlags,         // flags
  1191.                       [in, out] DWORD *pvContext   // Unused - set to NULL
  1192.                     );
  1193.  
  1194. #if 0
  1195.     // Method looks for a filter which supports the specified interface.  If such
  1196.     // a filter exists, an AddRef()'ed pointer to the requested interface is placed
  1197.     // in *ppInterface.
  1198.     //
  1199.     // *ppInterface will be NULL on return if such a filter could not be found, and
  1200.     // the method will return E_NOINTERFACE.
  1201.     //
  1202.     // pdwIndex is an internal index that is used for obtaining subsequent interfaces.
  1203.     // *pdwIndex should be initialized to zero.  It is set on return to a value that
  1204.     // allows the implementation of FindFilterInterface to search for further interfaces
  1205.     // if called again.  If no more such interfaces exist, the method will return E_NOINTERFACE.
  1206.     //
  1207.     // If pdwIndex is NULL, FindFilterInterface returns an interface only if there is just
  1208.     // a single filter in the graph that supports the interface.  Otherwise it returns
  1209.     // E_NOINTERFACE.
  1210.     //
  1211.     HRESULT FindFilterInterface( [in] REFIID iid, [out] void ** ppInterface, [in,out] LPDWORD pdwIndex );
  1212.  
  1213.     // Tries to obtain the interface from the filter graph itself.  If this fails,
  1214.     // it attempts to find the unique filter that supports the interface.
  1215.     // On failure the method will return E_NOINTERFACE.  On success, it returns
  1216.     // S_OK and an AddRef()'ed pointer to the requested interface in *ppInterface.
  1217.     //
  1218.     HRESULT FindInterface( [in] REFIID iid, [out] void ** ppInterface );
  1219.  
  1220. #endif
  1221. }
  1222.  
  1223. //
  1224. // StreamBuilder
  1225. // aka Graph building with constraints
  1226. // aka convergent graphs
  1227. // aka Closed captioning
  1228.  
  1229. [
  1230.     object,
  1231.     local,
  1232.     uuid(56a868bf-0ad4-11ce-b03a-0020af0ba770),
  1233.     pointer_default(unique)
  1234. ]
  1235. interface IStreamBuilder : IUnknown {
  1236.  
  1237.     // Connect this output pin directly or indirectly, using transform filters
  1238.     // if necessary to thing(s) that will render it, within this graph
  1239.     // Move from Initial state to Rendered state.
  1240.  
  1241.     HRESULT Render
  1242.         ( [in] IPin * ppinOut,         // the output pin
  1243.           [in] IGraphBuilder * pGraph  // the graph
  1244.         );
  1245.  
  1246.     // Undo what you did in Render.  Return to Initial state.
  1247.     HRESULT Backout
  1248.         ( [in] IPin * ppinOut,         // the output pin
  1249.           [in] IGraphBuilder * pGraph  // the graph
  1250.         );
  1251. }
  1252.  
  1253.  
  1254. // async reader interface - supported by file source filters. Allows
  1255. // multiple overlapped reads from different positions
  1256.  
  1257.  
  1258. [
  1259.         object,
  1260.         uuid(56a868aa-0ad4-11ce-b03a-0020af0ba770),
  1261.         pointer_default(unique)
  1262. ]
  1263. interface IAsyncReader : IUnknown
  1264. {
  1265.     // pass in your preferred allocator and your preferred properties.
  1266.     // method returns the actual allocator to be used. Call GetProperties
  1267.     // on returned allocator to learn alignment and prefix etc chosen.
  1268.     // this allocator will be not be committed and decommitted by
  1269.     // the async reader, only by the consumer.
  1270.     // Must call this before calling Request.
  1271.     HRESULT RequestAllocator(
  1272.                 [in]  IMemAllocator* pPreferred,
  1273.                 [in]  ALLOCATOR_PROPERTIES* pProps,
  1274.                 [out] IMemAllocator ** ppActual);
  1275.  
  1276.     // queue a request for data.
  1277.     // media sample start and stop times contain the requested absolute
  1278.     // byte position (start inclusive, stop exclusive).
  1279.     // may fail if sample not obtained from agreed allocator.
  1280.     // may fail if start/stop position does not match agreed alignment.
  1281.     // samples allocated from source pin's allocator may fail
  1282.     // GetPointer until after returning from WaitForNext.
  1283.     // Stop position must be aligned - this means it may exceed duration.
  1284.     // on completion, stop position will be corrected to unaligned
  1285.     // actual data.
  1286.     HRESULT Request(
  1287.                 [in] IMediaSample* pSample,
  1288.                 [in] DWORD_PTR dwUser);            // user context
  1289.  
  1290.     // block until the next sample is completed or the timeout occurs.
  1291.     // timeout (millisecs) may be 0 or INFINITE. Samples may not
  1292.     // be delivered in order. If there is a read error of any sort, a
  1293.     // notification will already have been sent by the source filter,
  1294.     // and HRESULT will be an error.
  1295.     // If ppSample is not null, then a Request completed with the result
  1296.     // code returned.
  1297.     HRESULT WaitForNext(
  1298.                 [in]  DWORD dwTimeout,
  1299.                 [out] IMediaSample** ppSample,  // completed sample
  1300.                 [out] DWORD_PTR * pdwUser);        // user context
  1301.  
  1302.     // sync read of data. Sample passed in must have been acquired from
  1303.     // the agreed allocator. Start and stop position must be aligned.
  1304.     // equivalent to a Request/WaitForNext pair, but may avoid the
  1305.     // need for a thread on the source filter.
  1306.     HRESULT SyncReadAligned(
  1307.                 [in] IMediaSample* pSample);
  1308.  
  1309.  
  1310.     // sync read. works in stopped state as well as run state.
  1311.     // need not be aligned. Will fail if read is beyond actual total
  1312.     // length.
  1313.     HRESULT SyncRead(
  1314.                 [in]  LONGLONG llPosition,    // absolute file position
  1315.                 [in]  LONG lLength,        // nr bytes required
  1316.                 [out, size_is(lLength)]
  1317.               BYTE* pBuffer);        // write data here
  1318.  
  1319.     // return total length of stream, and currently available length.
  1320.     // reads for beyond the available length but within the total length will
  1321.     // normally succeed but may block for a long period.
  1322.     HRESULT Length(
  1323.                 [out] LONGLONG* pTotal,
  1324.                 [out] LONGLONG* pAvailable);
  1325.  
  1326.     // cause all outstanding reads to return, possibly with a failure code
  1327.     //(VFW_E_TIMEOUT) indicating they were cancelled.
  1328.     // Between BeginFlush and EndFlush calls, Request calls will fail and
  1329.     // WaitForNext calls will always complete immediately.
  1330.     HRESULT BeginFlush(void);
  1331.     HRESULT EndFlush(void);
  1332. }
  1333.  
  1334.  
  1335. // interface provided by the filtergraph itself to let other objects
  1336. // (especially plug-in distributors, but also apps like graphedt) know
  1337. // when the graph has changed.
  1338. [
  1339.     object,
  1340.     uuid(56a868ab-0ad4-11ce-b03a-0020af0ba770),
  1341.     pointer_default(unique)
  1342. ]
  1343. interface IGraphVersion : IUnknown
  1344. {
  1345.     // returns the current graph version number
  1346.     // this is incremented every time there is a change in the
  1347.     // set of filters in the graph or in their connections
  1348.     //
  1349.     // if this is changed since your last enumeration, then re-enumerate
  1350.     // the graph
  1351.     HRESULT QueryVersion(LONG* pVersion);
  1352. }
  1353.  
  1354.  
  1355.  
  1356.  
  1357. //
  1358. // interface describing an object that uses resources.
  1359. //
  1360. // implement if: you request resources using IResourceManager. You will
  1361. // need to pass your implementation of this pointer as an in param.
  1362. //
  1363. // use if: you are a resource manager who implements IResourceManager
  1364. [
  1365.     object,
  1366.     uuid(56a868ad-0ad4-11ce-b03a-0020af0ba770),
  1367.     pointer_default(unique)
  1368. ]
  1369. interface IResourceConsumer : IUnknown
  1370. {
  1371.     // you may acquire the resource specified.
  1372.     // return values:
  1373.     //      S_OK    -- I have successfully acquired it
  1374.     //      S_FALSE -- I will acquire it and call NotifyAcquire afterwards
  1375.     //      VFW_S_NOT_NEEDED: I no longer need the resource
  1376.     //      FAILED(hr)-I tried to acquire it and failed.
  1377.  
  1378.     HRESULT
  1379.     AcquireResource(
  1380.         [in] LONG idResource);
  1381.  
  1382.  
  1383.  
  1384.     // Please release the resource.
  1385.     // return values:
  1386.     //      S_OK    -- I have released it (and want it again when available)
  1387.     //      S_FALSE -- I will call NotifyRelease when I have released it
  1388.     //      other   something went wrong.
  1389.     HRESULT
  1390.     ReleaseResource(
  1391.         [in] LONG idResource);
  1392. }
  1393.  
  1394.  
  1395.  
  1396. // interface describing a resource manager that will resolve contention for
  1397. // named resources.
  1398. //
  1399. // implement if: you are a resource manager. The filtergraph will be a resource
  1400. // manager, internally delegating to the system wide resource manager
  1401. // (when there is one)
  1402. //
  1403. // use if: you need resources that are limited. Use the resource manager to
  1404. // resolve contention by registering the resource with this interface,
  1405. // and requesting it from this interface whenever needed.
  1406. //
  1407. // or use if: you detect focus changes which should affect resource usage.
  1408. // Notifying change of focus to the resource manager will cause the resource
  1409. // manager to switch contended resources to the objects that have the user's
  1410. // focus
  1411. [
  1412.     object,
  1413.     uuid(56a868ac-0ad4-11ce-b03a-0020af0ba770),
  1414.     pointer_default(unique)
  1415. ]
  1416. interface IResourceManager : IUnknown
  1417. {
  1418.     // tell the manager how many there are of a resource.
  1419.     // ok if already registered. will take new count. if new count
  1420.     // is lower, will de-allocate resources to new count.
  1421.     //
  1422.     // You get back a token that will be used in further calls.
  1423.     //
  1424.     // Passing a count of 0 will eliminate this resource. There is currently
  1425.     // no defined way to find the id without knowing the count.
  1426.     //
  1427.     HRESULT
  1428.     Register(
  1429.         [in] LPCWSTR pName,         // this named resource
  1430.         [in] LONG   cResource,      // has this many instances
  1431.         [out] LONG* plToken         // token placed here on return
  1432.         );
  1433.  
  1434.     HRESULT
  1435.     RegisterGroup(
  1436.         [in] LPCWSTR pName,         // this named resource group
  1437.         [in] LONG cResource,        // has this many resources
  1438.         [in, size_is(cResource)]
  1439.              LONG* palTokens,      // these are the contained resources
  1440.         [out] LONG* plToken        // group resource id put here on return
  1441.         );
  1442.  
  1443.     // request the use of a given, registered resource.
  1444.     // possible return values:
  1445.     //      S_OK == yes you can use it now
  1446.     //      S_FALSE == you will be called back when the resource is available
  1447.     //      other - there is an error.
  1448.     //
  1449.     // The priority of this request should be affected by the associated
  1450.     // focus object -- that is, when SetFocus is called for that focus
  1451.     // object (or a 'related' object) then my request should be put through.
  1452.     //
  1453.     // A filter should pass the filter's IUnknown here. The filtergraph
  1454.     // will match filters to the filtergraph, and will attempt to trace
  1455.     // filters to common source filters when checking focus objects.
  1456.     // The Focus object must be valid for the entire lifetime of the request
  1457.     // -- until you call CancelRequest or NotifyRelease(id, p, FALSE)
  1458.     HRESULT
  1459.     RequestResource(
  1460.         [in] LONG idResource,
  1461.         [in] IUnknown* pFocusObject,
  1462.         [in] IResourceConsumer* pConsumer
  1463.         );
  1464.  
  1465.  
  1466.     // notify the resource manager that an acquisition attempt completed.
  1467.     // Call this method after an AcquireResource method returned
  1468.     // S_FALSE to indicate asynchronous acquisition.
  1469.     // HR should be S_OK if the resource was successfully acquired, or a
  1470.     // failure code if the resource could not be acquired.
  1471.     HRESULT
  1472.     NotifyAcquire(
  1473.         [in] LONG idResource,
  1474.         [in] IResourceConsumer* pConsumer,
  1475.         [in] HRESULT hr);
  1476.  
  1477.     // Notify the resource manager that you have released a resource. Call
  1478.     // this in response to a ReleaseResource method, or when you have finished
  1479.     // with the resource. bStillWant should be TRUE if you still want the
  1480.     // resource when it is next available, or FALSE if you no longer want
  1481.     // the resource.
  1482.     HRESULT
  1483.     NotifyRelease(
  1484.         [in] LONG idResource,
  1485.         [in] IResourceConsumer* pConsumer,
  1486.         [in] BOOL bStillWant);
  1487.  
  1488.     // I don't currently have the resource, and I no longer need it.
  1489.     HRESULT
  1490.     CancelRequest(
  1491.         [in] LONG idResource,
  1492.         [in] IResourceConsumer* pConsumer);
  1493.  
  1494.     // Notify the resource manager that a given object has been given the
  1495.     // user's focus. In ActiveMovie, this will normally be a video renderer
  1496.     // whose window has received the focus. The filter graph will switch
  1497.     // contended resources to (in order):
  1498.     //      requests made with this same focus object
  1499.     //      requests whose focus object shares a common source with this
  1500.     //      requests whose focus object shares a common filter graph
  1501.     // After calling this, you *must* call ReleaseFocus before the IUnknown
  1502.     // becomes invalid, unless you can guarantee that another SetFocus
  1503.     // of a different object is done in the meantime. No addref is held.
  1504.     //
  1505.     // The resource manager will hold this pointer until replaced or cancelled,
  1506.     // and will use it to resolve resource contention. It will call
  1507.     // QueryInterface for IBaseFilter at least and if found will call methods on
  1508.     // that interface.
  1509.     HRESULT
  1510.     SetFocus(
  1511.         [in] IUnknown* pFocusObject);
  1512.  
  1513.     // Sets the focus to NULL if the current focus object is still
  1514.     // pFocusObject. Call this when
  1515.     // the focus object is about to be destroyed to ensure that no-one is
  1516.     // still referencing the object.
  1517.     HRESULT
  1518.     ReleaseFocus(
  1519.         [in] IUnknown* pFocusObject);
  1520.  
  1521.  
  1522.  
  1523. // !!! still need
  1524. //      -- app override (some form of SetPriority)
  1525. //      -- enumeration and description of resources
  1526.  
  1527. }
  1528.  
  1529.  
  1530. //
  1531. // Interface representing an object that can be notified about state
  1532. // and other changes within a filter graph. The filtergraph will call plug-in
  1533. // distributors that expose this optional interface so that they can
  1534. // respond to appropriate changes.
  1535. //
  1536. // Implement if: you are a plug-in distributor (your class id is found
  1537. // under HKCR\Interface\<IID>\Distributor= for some interface).
  1538. //
  1539. // Use if: you are the filtergraph.
  1540. [
  1541.     object,
  1542.     uuid(56a868af-0ad4-11ce-b03a-0020af0ba770),
  1543.     pointer_default(unique)
  1544. ]
  1545. interface IDistributorNotify : IUnknown
  1546. {
  1547.     // called when graph is entering stop state. Called before
  1548.     // filters are stopped.
  1549.     HRESULT Stop(void);
  1550.  
  1551.     // called when graph is entering paused state, before filters are
  1552.     // notified
  1553.     HRESULT Pause(void);
  1554.  
  1555.     // called when graph is entering running state, before filters are
  1556.     // notified. tStart is the stream-time offset parameter that will be
  1557.     // given to each filter's IBaseFilter::Run method.
  1558.     HRESULT Run(REFERENCE_TIME tStart);
  1559.  
  1560.     // called when the graph's clock is changing, with the new clock. Addref
  1561.     // the clock if you hold it beyond this method. Called before
  1562.     // the filters are notified.
  1563.     HRESULT SetSyncSource(
  1564.         [in] IReferenceClock * pClock);
  1565.  
  1566.     // called when the set of filters or their connections has changed.
  1567.     // Called on every AddFilter, RemoveFilter or ConnectDirect (or anything
  1568.     // that will lead to one of these).
  1569.     // You don't need to rebuild your list of interesting filters at this point
  1570.     // but you should release any refcounts you hold on any filters that
  1571.     // have been removed.
  1572.     HRESULT NotifyGraphChange(void);
  1573. }
  1574.  
  1575. typedef enum {
  1576.     AM_STREAM_INFO_START_DEFINED = 0x00000001,
  1577.     AM_STREAM_INFO_STOP_DEFINED  = 0x00000002,
  1578.     AM_STREAM_INFO_DISCARDING    = 0x00000004,
  1579.     AM_STREAM_INFO_STOP_SEND_EXTRA = 0x00000010
  1580. } AM_STREAM_INFO_FLAGS;
  1581.  
  1582. //  Stream information
  1583. typedef struct {
  1584.     REFERENCE_TIME tStart;
  1585.     REFERENCE_TIME tStop;
  1586.     DWORD dwStartCookie;
  1587.     DWORD dwStopCookie;
  1588.     DWORD dwFlags;
  1589. } AM_STREAM_INFO;
  1590.  
  1591. //
  1592. // IAMStreamControl
  1593. //
  1594.  
  1595. [
  1596.     object,
  1597.     uuid(36b73881-c2c8-11cf-8b46-00805f6cef60),
  1598.     pointer_default(unique)
  1599. ]
  1600. interface IAMStreamControl : IUnknown
  1601. {
  1602.     // The REFERENCE_TIME pointers may be null, which
  1603.     // indicates immediately.  If the pointer is non-NULL
  1604.     // and dwCookie is non-zero, then pins should send
  1605.     // EC_STREAM_CONTROL_STOPPED / EC_STREAM_CONTROL_STARTED
  1606.     // with an IPin pointer and the cookie, thus allowing
  1607.     // apps to tie the events back to their requests.
  1608.     // If either dwCookies is zero, or the pointer is null,
  1609.     // then no event is sent.
  1610.  
  1611.     // If you have a capture pin hooked up to a MUX input pin and they
  1612.     // both support IAMStreamControl, you'll want the MUX to signal the
  1613.     // stop so you know the last frame was written out.  In order for the
  1614.     // MUX to know it's finished, the capture pin will have to send one
  1615.     // extra sample after it was supposed to stop, so the MUX can trigger
  1616.     // off that.  So you would set bSendExtra to TRUE for the capture pin
  1617.     // Leave it FALSE in all other cases.
  1618.  
  1619.     HRESULT StartAt( [in] const REFERENCE_TIME * ptStart,
  1620.                      [in] DWORD dwCookie );
  1621.     HRESULT StopAt(  [in] const REFERENCE_TIME * ptStop,
  1622.                      [in] BOOL bSendExtra,
  1623.                      [in] DWORD dwCookie );
  1624.     HRESULT GetInfo( [out] AM_STREAM_INFO *pInfo);
  1625. }
  1626.  
  1627.  
  1628.  
  1629. //
  1630. // ISeekingPassThru
  1631. //
  1632.  
  1633. [
  1634.     object,
  1635.     uuid(36b73883-c2c8-11cf-8b46-00805f6cef60),
  1636.     pointer_default(unique)
  1637. ]
  1638. interface ISeekingPassThru : IUnknown
  1639. {
  1640.     HRESULT Init(  [in] BOOL bSupportRendering,
  1641.                    [in] IPin *pPin);
  1642. }
  1643.  
  1644.  
  1645.  
  1646. //
  1647. // IAMStreamConfig - pin interface
  1648. //
  1649.  
  1650. // A capture filter or compression filter's output pin
  1651. // supports this interface - no matter what data type you produce.
  1652.  
  1653. // This interface can be used to set the output format of a pin (as an
  1654. // alternative to connecting the pin using a specific media type).
  1655. // After setting an output format, the pin will use that format
  1656. // the next time it connects to somebody, so you can just Render that
  1657. // pin and get a desired format without using Connect(CMediaType)
  1658. // Your pin should do that by ONLY OFFERING the media type set in SetFormat
  1659. // in its enumeration of media types, and no others.  This will ensure that
  1660. // that format is indeed used for connection (or at least offer it first).
  1661. // An application interested in enumerating accepted mediatypes may have to
  1662. // do so BEFORE calling SetFormat.
  1663.  
  1664. // But this interface's GetStreamCaps function can get more information
  1665. // about accepted media types than the traditional way of enumerating a pin's
  1666. // media types, so it should typically be used instead.
  1667. // GetStreamCaps gets information about the kinds of formats allowed... how
  1668. // it can stretch and crop, and the frame rate and data rates allowed (for
  1669. // video)
  1670.  
  1671. // VIDEO EXAMPLE
  1672. //
  1673. // GetStreamCaps returns a whole array of {MediaType, Capabilities}.
  1674. // Let's say your capture card supports JPEG anywhere between 160x120 and
  1675. // 320x240, and also the size 640x480.  Also, say it supports RGB24 at
  1676. // resolutions between 160x120 and 320x240 but only multiples of 8.  You would
  1677. // expose these properties by offering a media type of 320 x 240 JPEG
  1678. // (if that is your default or preferred size) coupled with
  1679. // capabilities saying minimum 160x120 and maximum 320x240 with granularity of
  1680. // 1.  The next pair you expose is a media type of 640x480 JPEG coupled with
  1681. // capabilities of min 640x480 max 640x480.  The third pair is media type
  1682. // 320x240 RGB24 with capabilities min 160x120 max 320x240 granularity 8.
  1683. // In this way you can expose almost every quirk your card might have.
  1684. // An application interested in knowing what compression formats you provide
  1685. // can get all the pairs and make a list of all the unique sub types of the
  1686. // media types.
  1687. //
  1688. // If a filter's output pin is connected with a media type that has rcSource
  1689. // and rcTarget not empty, it means the filter is being asked to stretch the
  1690. // rcSource sub-rectangle of its InputSize (the format of the input pin for
  1691. // a compressor, and the largest bitmap a capture filter can generate with
  1692. // every pixel unique) into the rcTarget sub-rectangle of its output format.
  1693. // For instance, if a video compressor has as input 160x120 RGB, and as output
  1694. // 320x240 MPEG with an rcSource of (10,10,20,20) and rcTarget of (0,0,100,100)
  1695. // this means the compressor is being asked to take a 10x10 piece of the 160x120
  1696. // RGB bitmap, and make it fill the top 100x100 area of a 320x240 bitmap,
  1697. // leaving the rest of the 320x240 bitmap untouched.
  1698. // A filter does not have to support this and can fail to connect with a
  1699. // media type where rcSource and rcTarget are not empty.
  1700. //
  1701. // Your output pin is connected to the next filter with a certain media
  1702. // type (either directly or using the media type passed by SetFormat),
  1703. // and you need to look at the AvgBytesPerSecond field of the format
  1704. // of that mediatype to see what data rate you are being asked to compress
  1705. // the video to, and use that data rate.  Using the number of frames per
  1706. // second in AvgTimePerFrame, you can figure out how many bytes each frame
  1707. // is supposed to be.  You can make it smaller, but NEVER EVER make a bigger
  1708. // data rate.  For a video compressor, your input pin's media type tells you
  1709. // the frame rate (use that AvgTimePerFrame).  For a capture filter, the
  1710. // output media type tells you, so use that AvgTimePerFrame.
  1711. //
  1712. // The cropping rectangle described below is the same as the rcSrc of the
  1713. // output pin's media type.
  1714. //
  1715. // The output rectangle described below is the same of the width and height
  1716. // of the BITMAPINFOHEADER of the media type of the output pin's media type
  1717.  
  1718.  
  1719. // AUDIO EXAMPLE
  1720. //
  1721. // This API can return an array of pairs of (media type, capabilities).
  1722. // This can be used to expose all kinds of wierd capabilities.  Let's say you
  1723. // do any PCM frequency from 11,025 to 44,100 at 8 or 16 bit mono or
  1724. // stereo, and you also do 48,000 16bit stereo as a special combination.
  1725. // You would expose 3 pairs.  The first pair would have Min Freq of 11025 and
  1726. // Max Freq of 44100, with MaxChannels=2 and MinBits=8 and MaxBits=8 for the
  1727. // capabilites structure, and a media type of anything you like, maybe
  1728. // 22kHz, 8bit stereo as a default.
  1729. // The 2nd pair would be the same except for MinBits=16 and MaxBits=16 in
  1730. // the capabilities structure and the media type could be something like
  1731. // 44kHz, 16bit stereo as a default (the media type in the pair should always
  1732. // be something legal as described by the capabilities structure... the
  1733. // structure tells you how you can change the media type to produce other
  1734. // legal media types... for instance changing 44kHz to 29010Hz would be legal,
  1735. // but changing bits from 16 to 14 would not be.)
  1736. // The 3rd pair would be MinFreq=48000 MaxFreq=48000 MaxChannels=2
  1737. // MinBits=16 and MaxBits=16, and the media type would be 48kHz 16bit stereo.
  1738. // You can also use the Granularity elements of the structure (like the example
  1739. // for video) if you support values that multiples of n, eg.  you could say
  1740. // minimum bits per sample 8, max 16, and granularity 8 to describe doing
  1741. // either 8 or 16 bit all in one structure
  1742. //
  1743. // If you support non-PCM formats, the media type returned in GetStreamCaps
  1744. // can show which non-PCM formats you support (with a default sample rate,
  1745. // bit rate and channels) and the capabilities structure going with that
  1746. // media type can describe which other sample rates, bit rates and channels
  1747. // you support.
  1748.  
  1749. [
  1750.     object,
  1751.     uuid(C6E13340-30AC-11d0-A18C-00A0C9118956),
  1752.     pointer_default(unique)
  1753. ]
  1754. interface IAMStreamConfig : IUnknown
  1755. {
  1756.  
  1757.     // this is the structure returned by a VIDEO filter
  1758.     //
  1759.     typedef struct _VIDEO_STREAM_CONFIG_CAPS {
  1760.  
  1761.     GUID        guid;    // will be MEDIATYPE_Video
  1762.  
  1763.     // the logical or of all the AnalogVideoStandard's supported
  1764.     // typically zero if not supported
  1765.     ULONG        VideoStandard;
  1766.  
  1767.     // the inherent size of the incoming signal... taken from the input
  1768.     // pin for a compressor, or the largest size a capture filter can
  1769.     // digitize the signal with every pixel still unique
  1770.         SIZE        InputSize;
  1771.  
  1772.     // The input of a compressor filter may have to be connected for these
  1773.     // to be known
  1774.  
  1775.     // smallest rcSrc cropping rect allowed
  1776.         SIZE        MinCroppingSize;
  1777.     // largest rcSrc cropping rect allowed
  1778.         SIZE        MaxCroppingSize;
  1779.     // granularity of cropping size - eg only widths a multiple of 4 allowed
  1780.         int         CropGranularityX;
  1781.         int         CropGranularityY;
  1782.     // alignment of cropping rect - eg rect must start on multiple of 4
  1783.     int        CropAlignX;
  1784.     int        CropAlignY;
  1785.  
  1786.     // The input of a compressor filter may have to be connected for these
  1787.     // to be known
  1788.  
  1789.     // smallest bitmap this pin can produce
  1790.         SIZE        MinOutputSize;
  1791.     // largest bitmap this pin can produce
  1792.         SIZE        MaxOutputSize;
  1793.     // granularity of output bitmap size
  1794.         int         OutputGranularityX;
  1795.         int         OutputGranularityY;
  1796.     // !!! what about alignment of rcTarget inside BIH if different?
  1797.  
  1798.     // how well can you stretch in the x direction?  0==not at all
  1799.     // 1=pixel doubling 2=interpolation(2 taps) 3=better interpolation
  1800.     // etc.
  1801.     int        StretchTapsX;
  1802.     int        StretchTapsY;
  1803.     // how well can you shrink in the x direction?  0==not at all
  1804.     // 1=pixel doubling 2=interpolation(2 taps) 3=better interpolation
  1805.     // etc.
  1806.     int        ShrinkTapsX;
  1807.     int        ShrinkTapsY;
  1808.  
  1809.     // CAPTURE filter only - what frame rates are allowed?
  1810.         LONGLONG    MinFrameInterval;
  1811.         LONGLONG    MaxFrameInterval;
  1812.  
  1813.     // what data rates can this pin produce?
  1814.         LONG        MinBitsPerSecond;
  1815.         LONG        MaxBitsPerSecond;
  1816.     } VIDEO_STREAM_CONFIG_CAPS;
  1817.  
  1818.  
  1819.     // this is the structure returned by an AUDIO filter
  1820.     //
  1821.     typedef struct _AUDIO_STREAM_CONFIG_CAPS {
  1822.  
  1823.       GUID       guid;    // will be MEDIATYPE_Audio
  1824.     ULONG        MinimumChannels;
  1825.        ULONG      MaximumChannels;
  1826.     ULONG      ChannelsGranularity;
  1827.        ULONG      MinimumBitsPerSample;
  1828.        ULONG      MaximumBitsPerSample;
  1829.     ULONG      BitsPerSampleGranularity;
  1830.        ULONG      MinimumSampleFrequency;
  1831.        ULONG      MaximumSampleFrequency;
  1832.     ULONG      SampleFrequencyGranularity;
  1833.     } AUDIO_STREAM_CONFIG_CAPS;
  1834.  
  1835.     // - only allowed when pin is not streaming, else the call will FAIL
  1836.     // - If your output pin is not yet connected, and you can
  1837.     //   connect your output pin with this media type, you should
  1838.     //   succeed the call, and start offering it first (enumerate as format#0)
  1839.     //   from GetMediaType so that this format will be used to connect with
  1840.     //   when you do connect to somebody
  1841.     // - if your output pin is already connected, and you can provide this
  1842.     //   type, reconnect your pin.  If the other pin can't accept it, FAIL
  1843.     //   this call and leave your connection alone.
  1844.     HRESULT SetFormat(
  1845.             [in] AM_MEDIA_TYPE *pmt);
  1846.  
  1847.     // the format it's connected with, or will connect with
  1848.     // the application is responsible for calling DeleteMediaType(*ppmt);
  1849.     HRESULT GetFormat(
  1850.             [out] AM_MEDIA_TYPE **ppmt);
  1851.  
  1852.     // how many different Stream Caps structures are there?
  1853.     // also, how big is the stream caps structure?
  1854.     HRESULT GetNumberOfCapabilities(
  1855.             [out] int *piCount,
  1856.         [out] int *piSize);    // pSCC of GetStreamCaps needs to be this big
  1857.  
  1858.     // - gets one of the pairs of {Mediatype, Caps}
  1859.     // - return S_FALSE if iIndex is too high
  1860.     // - the application is responsible for calling DeleteMediaType(*ppmt);
  1861.     // - the first thing pSCC points to is a GUID saying MEDIATYPE_Video
  1862.     //   or MEDIATYPE_Audio, so you can tell if you have a pointer to a
  1863.     //   VIDEO_STREAM_CONFIG_CAPS or an AUDIO_STREAM_CONFIG_CAPS structure
  1864.     //   There could potentially be many more possibilities other than video
  1865.     //   or audio.
  1866.     HRESULT GetStreamCaps(
  1867.         [in]  int iIndex,    // 0 to #caps-1
  1868.         [out] AM_MEDIA_TYPE **ppmt,
  1869.             [out] BYTE *pSCC);
  1870.  
  1871. }
  1872.  
  1873.  
  1874.  
  1875. // Interface to control interleaving of different streams in one file
  1876. [
  1877. object,
  1878. uuid(BEE3D220-157B-11d0-BD23-00A0C911CE86),
  1879. pointer_default(unique)
  1880. ]
  1881. interface IConfigInterleaving : IUnknown
  1882. {
  1883.     import "unknwn.idl";
  1884.  
  1885.     typedef enum
  1886.     {
  1887.         // uninterleaved - samples written out in the order they
  1888.         // arrive.
  1889.         INTERLEAVE_NONE,
  1890.  
  1891.         // approximate interleaving with less overhead for video
  1892.         // capture
  1893.         INTERLEAVE_CAPTURE,
  1894.  
  1895.         // full, precise interleaving. slower.
  1896.         INTERLEAVE_FULL,
  1897.  
  1898.         // samples written out in the order they arrive. writes are
  1899.         // buffered
  1900.         INTERLEAVE_NONE_BUFFERED
  1901.  
  1902.     } InterleavingMode;
  1903.  
  1904.     HRESULT put_Mode(
  1905.         [in] InterleavingMode mode
  1906.         );
  1907.  
  1908.     HRESULT get_Mode(
  1909.         [out] InterleavingMode *pMode
  1910.         );
  1911.  
  1912.     HRESULT put_Interleaving(
  1913.         [in] const REFERENCE_TIME *prtInterleave,
  1914.         [in] const REFERENCE_TIME *prtPreroll
  1915.         );
  1916.  
  1917.     HRESULT get_Interleaving(
  1918.         [out] REFERENCE_TIME *prtInterleave,
  1919.         [out] REFERENCE_TIME *prtPreroll
  1920.         );
  1921. }
  1922.  
  1923. // Interface to control the AVI mux
  1924. [
  1925. object,
  1926. uuid(5ACD6AA0-F482-11ce-8B67-00AA00A3F1A6),
  1927. pointer_default(unique)
  1928. ]
  1929. interface IConfigAviMux : IUnknown
  1930. {
  1931.     import "unknwn.idl";
  1932.  
  1933.     // control whether the AVI mux adjusts the frame rate or audio
  1934.     // sampling rate for drift when the file is closed. -1 to disables
  1935.     // this behavior.
  1936.     HRESULT SetMasterStream([in] LONG iStream);
  1937.     HRESULT GetMasterStream([out] LONG *pStream);
  1938.  
  1939.     // control whether the AVI mux writes out an idx1 index chunk for
  1940.     // compatibility with older AVI players.
  1941.     HRESULT SetOutputCompatibilityIndex([in] BOOL fOldIndex);
  1942.     HRESULT GetOutputCompatibilityIndex([out] BOOL *pfOldIndex);
  1943. }
  1944.  
  1945.     //---------------------------------------------------------------------
  1946.     //  CompressionCaps enum
  1947.     //---------------------------------------------------------------------
  1948.  
  1949.     // This tells you which features of IAMVideoCompression are supported
  1950.  
  1951.     // CanCrunch means that it can compress video to a specified data rate
  1952.     // If so, then the output pin's media type will contain that data rate
  1953.     // in the format's AvgBytesPerSecond field, and that should be used.
  1954.  
  1955.     typedef enum
  1956.     {
  1957.         CompressionCaps_CanQuality =  0x01,
  1958.         CompressionCaps_CanCrunch =   0x02,
  1959.         CompressionCaps_CanKeyFrame = 0x04,
  1960.         CompressionCaps_CanBFrame =   0x08,
  1961.         CompressionCaps_CanWindow =   0x10
  1962.     } CompressionCaps;
  1963.  
  1964.  
  1965.  
  1966.     //---------------------------------------------------------------------
  1967.     // IAMVideoCompression interface
  1968.     //
  1969.     // Control compression parameters - pin interface
  1970.     //---------------------------------------------------------------------
  1971.  
  1972.     // This interface is implemented by the output pin of a video capture
  1973.     // filter or video compressor that provides video data
  1974.  
  1975.     // You use this interface to control how video is compressed... how
  1976.     // many keyframes, etc., and to find information like capabilities and
  1977.     // the description of this compressor
  1978.  
  1979.     [
  1980.     object,
  1981.         uuid(C6E13343-30AC-11d0-A18C-00A0C9118956),
  1982.         pointer_default(unique)
  1983.     ]
  1984.     interface IAMVideoCompression : IUnknown
  1985.     {
  1986.     // - Only valid if GetInfo's pCapabilities sets
  1987.     //   CompressionCaps_CanKeyFrame
  1988.         // - KeyFrameRate < 0 means use the compressor default
  1989.     // - KeyFrames == 0 means only the first frame is a key
  1990.         HRESULT put_KeyFrameRate (
  1991.                     [in] long KeyFrameRate);
  1992.  
  1993.         HRESULT get_KeyFrameRate (
  1994.                     [out] long * pKeyFrameRate);
  1995.  
  1996.     // - Only valid if GetInfo's pCapabilities sets
  1997.     //   CompressionCaps_CanBFrame
  1998.     // - If keyframes are every 10, and there are 3 P Frames per key,
  1999.     //   they will be spaced evenly between the key frames and the other
  2000.     //   6 frames will be B frames
  2001.     // - PFramesPerKeyFrame < 0 means use the compressor default
  2002.         HRESULT put_PFramesPerKeyFrame (
  2003.                     [in] long PFramesPerKeyFrame);
  2004.  
  2005.         HRESULT get_PFramesPerKeyFrame (
  2006.                     [out] long * pPFramesPerKeyFrame);
  2007.  
  2008.     // - Only valid if GetInfo's pCapabilities sets
  2009.     //   CompressionCaps_CanQuality
  2010.     // - Controls image quality
  2011.     // - If you are compressing to a fixed data rate, a high quality
  2012.     //   means try and use all of the data rate, and a low quality means
  2013.     //   feel free to use much lower than the data rate if you want to.
  2014.         // - Quality < 0 means use the compressor default
  2015.         HRESULT put_Quality (
  2016.                     [in] double Quality);
  2017.  
  2018.         HRESULT get_Quality (
  2019.                     [out] double * pQuality);
  2020.  
  2021.     // If you have set a data rate of 100K/sec on a 10fps movie, that
  2022.     // will normally mean each frame must be <=10K.  But a window size
  2023.     // means every consecutive n frames must average to the data rate,
  2024.     // but an individual frame (if n > 1) is allowed to exceed the
  2025.     // frame size suggested by the data rate
  2026.         HRESULT put_WindowSize (
  2027.                     [in] DWORDLONG WindowSize);
  2028.  
  2029.         HRESULT get_WindowSize (
  2030.                     [out] DWORDLONG * pWindowSize);
  2031.  
  2032.     // - pszVersion might be "Version 2.1.0"
  2033.     // - pszDescription might be "Danny's awesome video compressor"
  2034.     // - pcbVersion and pcbDescription will be filled in with the
  2035.     //   required length if they are too short
  2036.     // - *pCapabilities is a logical OR of some CompressionCaps flags
  2037.         HRESULT GetInfo(
  2038.                     [out, size_is(*pcbVersion)] WCHAR * pszVersion,
  2039.                     [in,out] int *pcbVersion,
  2040.                     [out, size_is(*pcbDescription)] LPWSTR pszDescription,
  2041.                     [in,out] int *pcbDescription,
  2042.             [out] long *pDefaultKeyFrameRate,
  2043.             [out] long *pDefaultPFramesPerKey,
  2044.             [out] double *pDefaultQuality,
  2045.                     [out] long *pCapabilities  //CompressionCaps
  2046.         );
  2047.  
  2048.     // - this means when this frame number comes along after the graph
  2049.     //   is running, make it a keyframe even if you weren't going to
  2050.         HRESULT OverrideKeyFrame(
  2051.                     [in]  long FrameNumber
  2052.         );
  2053.  
  2054.     // - Only valid if GetInfo's pCapabilities sets
  2055.     //   CompressionCaps_CanCrunch
  2056.     // - this means when this frame number comes along after the graph
  2057.     //   is running, make it this many bytes big instead of whatever size
  2058.     //   you were going to make it.
  2059.         HRESULT OverrideFrameSize(
  2060.                     [in]  long FrameNumber,
  2061.                     [in]  long Size
  2062.         );
  2063.  
  2064.     }
  2065.  
  2066.     //---------------------------------------------------------------------
  2067.     //  VfwCaptureDialogs enum
  2068.     //---------------------------------------------------------------------
  2069.  
  2070.     typedef enum
  2071.     {
  2072.          VfwCaptureDialog_Source = 0x01,
  2073.      VfwCaptureDialog_Format = 0x02,
  2074.      VfwCaptureDialog_Display = 0x04
  2075.     } VfwCaptureDialogs;
  2076.  
  2077.  
  2078.     //---------------------------------------------------------------------
  2079.     //  VfwCompressDialogs enum
  2080.     //---------------------------------------------------------------------
  2081.  
  2082.     typedef enum
  2083.     {
  2084.          VfwCompressDialog_Config = 0x01,
  2085.      VfwCompressDialog_About =  0x02,
  2086.      // returns S_OK if the dialog exists and can be shown, else S_FALSE
  2087.          VfwCompressDialog_QueryConfig = 0x04,
  2088.      VfwCompressDialog_QueryAbout =  0x08
  2089.     } VfwCompressDialogs;
  2090.  
  2091.  
  2092.     //---------------------------------------------------------------------
  2093.     // IAMVfwCaptureDialogs - filter interface
  2094.     //
  2095.     // Show a VfW capture driver dialog - SOURCE, FORMAT, or DISPLAY
  2096.     //---------------------------------------------------------------------
  2097.  
  2098.     // This interface is supported only by Microsoft's Video For Windows
  2099.     // capture driver Capture Filter.  It allows an application to bring up
  2100.     // one of the 3 driver dialogs that VfW capture drivers have.
  2101.  
  2102.     [
  2103.     object,
  2104.         local,
  2105.         uuid(D8D715A0-6E5E-11D0-B3F0-00AA003761C5),
  2106.         pointer_default(unique)
  2107.     ]
  2108.     interface IAMVfwCaptureDialogs : IUnknown
  2109.     {
  2110.         HRESULT HasDialog(
  2111.                     [in]  int iDialog    // VfwCaptureDialogs enum
  2112.         );
  2113.  
  2114.         HRESULT ShowDialog(
  2115.                     [in]  int iDialog,    // VfwCaptureDialogs enum
  2116.             [in]  HWND hwnd
  2117.         );
  2118.  
  2119.         HRESULT SendDriverMessage(
  2120.                     [in]  int iDialog,    // VfwCaptureDialogs enum
  2121.                     [in]  int uMsg,
  2122.                     [in]  long dw1,
  2123.                     [in]  long dw2
  2124.         );
  2125.  
  2126.         // - iDialog can be one of the VfwCaptureDialogs enums
  2127.         // - HasDialog returns S_OK if it has the dialog, else S_FALSE
  2128.      // - ShowDialog can only be called when not streaming or when another
  2129.     //   dialog is not already up
  2130.     // - SendDriverMessage can send a private message to the capture driver.
  2131.     //   USE IT AT YOUR OWN RISK!
  2132.     }
  2133.  
  2134.     //---------------------------------------------------------------------
  2135.     // IAMVfwCompressDialogs - filter interface
  2136.     //
  2137.     // Show a VfW codec driver dialog - CONFIG or ABOUT
  2138.     //---------------------------------------------------------------------
  2139.  
  2140.     // This interface is supported only by Microsoft's ICM Compressor filter
  2141.     // (Co).  It allows an application to bring up either the Configure or
  2142.     // About dialogs for the ICM codec that it is currently using.
  2143.  
  2144.     [
  2145.     object,
  2146.     local,
  2147.         uuid(D8D715A3-6E5E-11D0-B3F0-00AA003761C5),
  2148.         pointer_default(unique)
  2149.     ]
  2150.     interface IAMVfwCompressDialogs : IUnknown
  2151.     {
  2152.  
  2153.         // Bring up a dialog for this codec
  2154.         HRESULT ShowDialog(
  2155.                     [in]  int iDialog,   // VfwCompressDialogs enum
  2156.             [in]  HWND hwnd
  2157.         );
  2158.  
  2159.         // Calls ICGetState and gives you the result
  2160.         HRESULT GetState(
  2161.                     [out, size_is(*pcbState)] LPVOID pState,
  2162.             [in, out]  int *pcbState
  2163.         );
  2164.  
  2165.         // Calls ICSetState
  2166.         HRESULT SetState(
  2167.                     [in, size_is(cbState)] LPVOID pState,
  2168.             [in]  int cbState
  2169.         );
  2170.  
  2171.         // Send a codec specific message
  2172.         HRESULT SendDriverMessage(
  2173.                     [in]  int uMsg,
  2174.                     [in]  long dw1,
  2175.                     [in]  long dw2
  2176.         );
  2177.  
  2178.         // - iDialog can be one of the VfwCaptureDialogs enums
  2179.      // - ShowDialog can only be called when not streaming or when no other
  2180.     //   dialog is up already
  2181.      // - an application can call GetState after ShowDialog(CONFIG) to
  2182.     //   see how the compressor was configured and next time the graph
  2183.        //   is used, it can call SetState with the data it saved to return
  2184.     //   the codec to the state configured by the dialog box from last time
  2185.     // - GetState with a NULL pointer returns the size needed
  2186.     // - SendDriverMessage can send a private message to the codec.
  2187.     //   USE IT AT YOUR OWN RISK!
  2188.     }
  2189.  
  2190.  
  2191.     //---------------------------------------------------------------------
  2192.     // IAMDroppedFrames interface
  2193.     //
  2194.     // Report status of capture - pin interface
  2195.     //---------------------------------------------------------------------
  2196.  
  2197.     // A capture filter's video output pin supports this.  It reports
  2198.     // how many frames were not sent (dropped), etc.
  2199.  
  2200.     // Every time your filter goes from STOPPED-->PAUSED, you reset all your
  2201.     // counts to zero.
  2202.  
  2203.     // An app may call this all the time while you are capturing to see how
  2204.     // capturing is going.  MAKE SURE you always return as current information
  2205.     // as possible while you are running.
  2206.  
  2207.     // When your capture filter starts running, it starts by sending frame 0,
  2208.     // then 1, 2, 3, etc.  The time stamp of each frame sent should correspond
  2209.     // to the graph clock's time when the image was digitized.  The end time
  2210.     // is the start time plus the duration of the video frame.
  2211.     // You should also set the MediaTime of each sample (SetMediaTime) as well.
  2212.     // This should be the frame number ie (0,1) (1,2) (2,3).
  2213.     // If a frame is dropped, a downstream filter will be able to tell easily
  2214.     // not by looking for gaps in the regular time stamps, but by noticing a
  2215.     // frame number is missing (eg.  (1,2) (2,3) (4,5) (5,6) means frame 3
  2216.     // was dropped.
  2217.  
  2218.     // Using the info provided by this interface, an application can figure out
  2219.     // the number of frames dropped, the frame rate achieved (the length of
  2220.     // time the graph was running divided by the number of frames not dropped),
  2221.     // and the data rate acheived (the length of time the graph was running
  2222.     // divided by the average frame size).
  2223.  
  2224.     // If your filter is running, then paused, and then run again, you need
  2225.     // to continue to deliver frames as if it was never paused.  The first
  2226.     // frame after the second RUN cannot be time stamped earlier than the last
  2227.     // frame sent before the pause.
  2228.  
  2229.     // Your filter must always increment the MediaTime of each sample sent.
  2230.     // Never send the same frame # twice, and never go back in time.  The
  2231.     // regular time stamp of a sample can also never go back in time.
  2232.  
  2233.     [
  2234.     object,
  2235.         uuid(C6E13344-30AC-11d0-A18C-00A0C9118956),
  2236.         pointer_default(unique)
  2237.     ]
  2238.     interface IAMDroppedFrames : IUnknown
  2239.     {
  2240.         // Get the number of dropped frames
  2241.         HRESULT GetNumDropped(
  2242.                     [out]  long * plDropped
  2243.  
  2244.         );
  2245.  
  2246.         //Get the number of non-dropped frames
  2247.         HRESULT GetNumNotDropped(
  2248.                     [out]  long * plNotDropped
  2249.  
  2250.         );
  2251.  
  2252.     // - plArray points to an array of lSize longs.  The filter will
  2253.     //   fill it with the frame number of the first lSize frames dropped.
  2254.     //   A filter may not have bothered to remember as many as you asked
  2255.     //   for, so it will set *plNumCopied to the number of frames it filled
  2256.     //   in.
  2257.         HRESULT GetDroppedInfo(
  2258.                     [in]   long lSize,
  2259.                     [out]  long * plArray,
  2260.                     [out]  long *  plNumCopied
  2261.         );
  2262.  
  2263.     // - This is the average size of the frames it didn't drop (in bytes)
  2264.         HRESULT GetAverageFrameSize(
  2265.                     [out]  long * plAverageSize
  2266.  
  2267.         );
  2268.  
  2269.     }
  2270.  
  2271.  
  2272.  
  2273.     cpp_quote("#define AMF_AUTOMATICGAIN -1.0")
  2274.  
  2275.     //---------------------------------------------------------------------
  2276.     // IAMAudioInputMixer interface
  2277.     //
  2278.     // Sets the recording levels, pan and EQ for the audio card inputs
  2279.     //---------------------------------------------------------------------
  2280.  
  2281.     // This interface is implemented by each input pin of an audio capture
  2282.     // filter, to tell it what level, panning, and EQ to use for each input.
  2283.     // The name of each pin will reflect the type of input, eg. "Line input 1"
  2284.     // or "Mic".  An application uses the pin names to decide how it wants to
  2285.     // set the recording levels
  2286.  
  2287.     // This interface can also be supported by the audio capture filter itself
  2288.     // to control to overall record level and panning after the mix
  2289.  
  2290.     [
  2291.     object,
  2292.         uuid(54C39221-8380-11d0-B3F0-00AA003761C5),
  2293.         pointer_default(unique)
  2294.     ]
  2295.     interface IAMAudioInputMixer : IUnknown
  2296.     {
  2297.     // This interface is only supported by the input pins, not the filter
  2298.      // If disabled, this channel will not be mixed in as part of the
  2299.     // recorded signal.
  2300.         HRESULT put_Enable (
  2301.             [in] BOOL fEnable);    // TRUE=enable FALSE=disable
  2302.  
  2303.     //Is this channel enabled?
  2304.         HRESULT get_Enable (
  2305.             [out] BOOL *pfEnable);
  2306.  
  2307.     // When set to mono mode, making a stereo recording of this channel
  2308.      // will have both channels contain the same data... a mixture of the
  2309.     // left and right signals
  2310.         HRESULT put_Mono (
  2311.             [in] BOOL fMono);    // TRUE=mono FALSE=multi channel
  2312.  
  2313.         //all channels combined into a mono signal?
  2314.         HRESULT get_Mono (
  2315.             [out] BOOL *pfMono);
  2316.  
  2317.      // !!! WILL CARDS BE ABLE TO BOOST THE GAIN?
  2318.         //Set the record level for this channel
  2319.         HRESULT put_MixLevel (
  2320.                     [in] double Level);    // 0 = off, 1 = full (unity?) volume
  2321.                     // AMF_AUTOMATICGAIN, if supported,
  2322.                     // means automatic
  2323.  
  2324.         //Get the record level for this channel
  2325.         HRESULT get_MixLevel (
  2326.                     [out] double *pLevel);
  2327.  
  2328.     // For instance, when panned full left, and you make a stereo recording
  2329.     // of this channel, you will record a silent right channel.
  2330.         HRESULT put_Pan (
  2331.                     [in] double Pan);    // -1 = full left, 0 = centre, 1 = right
  2332.  
  2333.         //Get the pan for this channel
  2334.         HRESULT get_Pan (
  2335.                     [out] double *pPan);
  2336.  
  2337.     // Boosts the bass of low volume signals before they are recorded
  2338.     // to compensate for the fact that your ear has trouble hearing quiet
  2339.     // bass sounds
  2340.         HRESULT put_Loudness (
  2341.             [in] BOOL fLoudness);// TRUE=on FALSE=off
  2342.  
  2343.         HRESULT get_Loudness (
  2344.             [out] BOOL *pfLoudness);
  2345.  
  2346.     // boosts or cuts the treble of the signal before it's recorded by
  2347.     // a certain amount of dB
  2348.         HRESULT put_Treble (
  2349.                     [in] double Treble); // gain in dB (-ve = attenuate)
  2350.  
  2351.         //Get the treble EQ for this channel
  2352.         HRESULT get_Treble (
  2353.                     [out] double *pTreble);
  2354.  
  2355.     // This is the maximum value allowed in put_Treble.  ie 6.0 means
  2356.     // any value between -6.0 and 6.0 is allowed
  2357.         HRESULT get_TrebleRange (
  2358.                     [out] double *pRange); // largest value allowed
  2359.  
  2360.     // boosts or cuts the bass of the signal before it's recorded by
  2361.     // a certain amount of dB
  2362.         HRESULT put_Bass (
  2363.                     [in] double Bass); // gain in dB (-ve = attenuate)
  2364.  
  2365.         // Get the bass EQ for this channel
  2366.         HRESULT get_Bass (
  2367.                     [out] double *pBass);
  2368.  
  2369.     // This is the maximum value allowed in put_Bass.  ie 6.0 means
  2370.     // any value between -6.0 and 6.0 is allowed
  2371.         HRESULT get_BassRange (
  2372.                     [out] double *pRange); // largest value allowed
  2373.  
  2374.     }
  2375.  
  2376.  
  2377.     //---------------------------------------------------------------------
  2378.     // IAMBufferNegotiation interface
  2379.     //
  2380.     // Tells a pin what kinds of buffers to use when connected
  2381.     //---------------------------------------------------------------------
  2382.  
  2383.     // This interface can be implemented by any pin that will connect to
  2384.     // another pin using IMemInputPin.  All capture filters should support
  2385.     // this interface.
  2386.  
  2387.     // SuggestAllocatorProperties is a way for an application to get
  2388.     // in on the buffer negotiation process for a pin.  This pin will use
  2389.     // the numbers given to it by the application as its request to the
  2390.     // allocator.  An application can use a negative number for any element
  2391.     // in the ALLOCATOR_PROPERTIES to mean "don't care".  An application must
  2392.     // call this function before the pin is connected, or it will be too late
  2393.     // To ensure that an application gets what it wants, it would be wise to
  2394.     // call this method on both pins being connected together, so the other
  2395.     // pin doesn't overrule the application's request.
  2396.  
  2397.     // GetAllocatorProperties can only be called after a pin is connected and
  2398.     // it returns the properties of the current allocator being used
  2399.  
  2400.     [
  2401.     object,
  2402.         uuid(56ED71A0-AF5F-11D0-B3F0-00AA003761C5),
  2403.         pointer_default(unique)
  2404.     ]
  2405.     interface IAMBufferNegotiation : IUnknown
  2406.     {
  2407.         HRESULT SuggestAllocatorProperties (
  2408.             [in] const ALLOCATOR_PROPERTIES *pprop);
  2409.  
  2410.         HRESULT GetAllocatorProperties (
  2411.             [out] ALLOCATOR_PROPERTIES *pprop);
  2412.  
  2413.     }
  2414.  
  2415.  
  2416.     //---------------------------------------------------------------------
  2417.     // AnalogVideoStandard enum
  2418.     //---------------------------------------------------------------------
  2419.  
  2420.     typedef enum tagAnalogVideoStandard
  2421.     {
  2422.         AnalogVideo_None     = 0x00000000,  // This is a digital sensor
  2423.         AnalogVideo_NTSC_M   = 0x00000001,  //        75 IRE Setup
  2424.         AnalogVideo_NTSC_M_J = 0x00000002,  // Japan,  0 IRE Setup
  2425.         AnalogVideo_NTSC_433 = 0x00000004,
  2426.  
  2427.         AnalogVideo_PAL_B    = 0x00000010,
  2428.         AnalogVideo_PAL_D    = 0x00000020,
  2429.         AnalogVideo_PAL_G    = 0x00000040,
  2430.         AnalogVideo_PAL_H    = 0x00000080,
  2431.         AnalogVideo_PAL_I    = 0x00000100,
  2432.         AnalogVideo_PAL_M    = 0x00000200,
  2433.         AnalogVideo_PAL_N    = 0x00000400,
  2434.  
  2435.         AnalogVideo_PAL_60   = 0x00000800,
  2436.  
  2437.         AnalogVideo_SECAM_B  = 0x00001000,
  2438.         AnalogVideo_SECAM_D  = 0x00002000,
  2439.         AnalogVideo_SECAM_G  = 0x00004000,
  2440.         AnalogVideo_SECAM_H  = 0x00008000,
  2441.         AnalogVideo_SECAM_K  = 0x00010000,
  2442.         AnalogVideo_SECAM_K1 = 0x00020000,
  2443.         AnalogVideo_SECAM_L  = 0x00040000,
  2444.         AnalogVideo_SECAM_L1 = 0x00080000,
  2445.  
  2446.         AnalogVideo_PAL_N_COMBO             // Argentina
  2447.                              = 0x00100000
  2448.     } AnalogVideoStandard;
  2449.  
  2450.     cpp_quote("#define AnalogVideo_NTSC_Mask  0x00000007")
  2451.     cpp_quote("#define AnalogVideo_PAL_Mask   0x00100FF0")
  2452.     cpp_quote("#define AnalogVideo_SECAM_Mask 0x000FF000")
  2453.  
  2454.  
  2455.     //---------------------------------------------------------------------
  2456.     // TunerInputType enum
  2457.     //---------------------------------------------------------------------
  2458.  
  2459.     typedef enum tagTunerInputType
  2460.     {
  2461.         TunerInputCable,
  2462.         TunerInputAntenna
  2463.     } TunerInputType;
  2464.  
  2465.     //---------------------------------------------------------------------
  2466.     // VideoCopyProtectionType enum
  2467.     //---------------------------------------------------------------------
  2468.  
  2469.     typedef enum
  2470.     {
  2471.         VideoCopyProtectionMacrovisionBasic,
  2472.         VideoCopyProtectionMacrovisionCBI
  2473.     } VideoCopyProtectionType;
  2474.  
  2475.     //---------------------------------------------------------------------
  2476.     // PhysicalConnectorType enum
  2477.     //---------------------------------------------------------------------
  2478.  
  2479.     typedef enum tagPhysicalConnectorType
  2480.     {
  2481.         PhysConn_Video_Tuner = 1,
  2482.         PhysConn_Video_Composite,
  2483.         PhysConn_Video_SVideo,
  2484.         PhysConn_Video_RGB,
  2485.         PhysConn_Video_YRYBY,
  2486.         PhysConn_Video_SerialDigital,
  2487.         PhysConn_Video_ParallelDigital,
  2488.         PhysConn_Video_SCSI,
  2489.         PhysConn_Video_AUX,
  2490.         PhysConn_Video_1394,
  2491.         PhysConn_Video_USB,
  2492.         PhysConn_Video_VideoDecoder,
  2493.         PhysConn_Video_VideoEncoder,
  2494.         PhysConn_Video_SCART,
  2495.         PhysConn_Video_Black,            
  2496.  
  2497.  
  2498.         PhysConn_Audio_Tuner = 0x1000,
  2499.         PhysConn_Audio_Line,
  2500.         PhysConn_Audio_Mic,
  2501.         PhysConn_Audio_AESDigital,
  2502.         PhysConn_Audio_SPDIFDigital,
  2503.         PhysConn_Audio_SCSI,
  2504.         PhysConn_Audio_AUX,
  2505.         PhysConn_Audio_1394,
  2506.         PhysConn_Audio_USB,
  2507.         PhysConn_Audio_AudioDecoder,
  2508.     } PhysicalConnectorType;
  2509.  
  2510.  
  2511.  
  2512.  
  2513.     //---------------------------------------------------------------------
  2514.     // IAMAnalogVideoDecoder interface
  2515.     //---------------------------------------------------------------------
  2516.  
  2517.     [
  2518.     object,
  2519.         uuid(C6E13350-30AC-11d0-A18C-00A0C9118956),
  2520.     pointer_default(unique)
  2521.     ]
  2522.     interface IAMAnalogVideoDecoder : IUnknown
  2523.     {
  2524.  
  2525.          //Gets the supported analog video standards (NTSC/M, PAL/B, SECAM/K1...
  2526.         HRESULT get_AvailableTVFormats(
  2527.                     [out] long *lAnalogVideoStandard
  2528.                     );
  2529.  
  2530.         //Sets or gets the current analog video standard (NTSC/M, PAL/B, SECAM/K1, ...
  2531.         HRESULT put_TVFormat(
  2532.                     [in] long lAnalogVideoStandard
  2533.                     );
  2534.  
  2535.         // Sets or gets the current analog video standard (NTSC/M, PAL/B, SECAM/K1, ...
  2536.         HRESULT get_TVFormat(
  2537.                     [out] long * plAnalogVideoStandard
  2538.                     );
  2539.  
  2540.         // True if horizontal sync is locked
  2541.         HRESULT get_HorizontalLocked (
  2542.                     [out] long * plLocked);
  2543.  
  2544.         // True if connected to a VCR (changes PLL timing)
  2545.         HRESULT put_VCRHorizontalLocking (
  2546.                     [in] long lVCRHorizontalLocking);
  2547.  
  2548.         HRESULT get_VCRHorizontalLocking (
  2549.                     [out] long * plVCRHorizontalLocking);
  2550.  
  2551.         // Returns the number of lines in the video signal")]
  2552.         HRESULT get_NumberOfLines (
  2553.                     [out] long *plNumberOfLines);
  2554.  
  2555.         // Enables or disables the output bus
  2556.         HRESULT put_OutputEnable (
  2557.                     [in] long lOutputEnable);
  2558.  
  2559.         HRESULT get_OutputEnable (
  2560.                     [out] long *plOutputEnable);
  2561.  
  2562.     }
  2563.  
  2564.  
  2565.     //---------------------------------------------------------------------
  2566.     // VideoProcAmp Property enum
  2567.     //---------------------------------------------------------------------
  2568.  
  2569.     typedef enum tagVideoProcAmpProperty
  2570.     {
  2571.         VideoProcAmp_Brightness,
  2572.         VideoProcAmp_Contrast,
  2573.         VideoProcAmp_Hue,
  2574.         VideoProcAmp_Saturation,
  2575.         VideoProcAmp_Sharpness,
  2576.         VideoProcAmp_Gamma,
  2577.         VideoProcAmp_ColorEnable,
  2578.         VideoProcAmp_WhiteBalance,
  2579.         VideoProcAmp_BacklightCompensation,
  2580.         VideoProcAmp_Gain
  2581.     } VideoProcAmpProperty;
  2582.  
  2583.     //---------------------------------------------------------------------
  2584.     // VideoProcAmp Flags enum
  2585.     //---------------------------------------------------------------------
  2586.  
  2587.     typedef enum tagVideoProcAmpFlags
  2588.     {
  2589.         VideoProcAmp_Flags_Auto   = 0x0001,
  2590.         VideoProcAmp_Flags_Manual = 0x0002
  2591.     } VideoProcAmpFlags;
  2592.  
  2593.     //---------------------------------------------------------------------
  2594.     // IAMVideoProcAmp interface
  2595.     //
  2596.     // Adjusts video quality in either the analog or digital domain.
  2597.     //
  2598.     //---------------------------------------------------------------------
  2599.  
  2600.     [
  2601.     object,
  2602.         uuid(C6E13360-30AC-11d0-A18C-00A0C9118956),
  2603.     pointer_default(unique)
  2604.     ]
  2605.     interface IAMVideoProcAmp : IUnknown
  2606.     {
  2607.         // Returns min, max, step size, and default values
  2608.         HRESULT GetRange(
  2609.             [in] long Property,         // Which property to query
  2610.             [out] long * pMin,          // Range minimum
  2611.             [out] long * pMax,          // Range maxumum
  2612.             [out] long * pSteppingDelta,// Step size
  2613.             [out] long * pDefault,      // Default value
  2614.             [out] long * pCapsFlags     // VideoProcAmpFlags
  2615.  
  2616.         );
  2617.  
  2618.         // Set a VideoProcAmp property
  2619.         HRESULT Set(
  2620.             [in]  long Property,        // VideoProcAmpProperty
  2621.             [in]  long lValue,          // Value to set
  2622.             [in]  long Flags            // VideoProcAmp_Flags_*
  2623.  
  2624.         );
  2625.  
  2626.         // Get a VideoProcAmp property
  2627.         HRESULT Get(
  2628.             [in]  long Property,        // VideoProcAmpProperty
  2629.             [out] long * lValue,        // Current value
  2630.             [out] long * Flags          // VideoProcAmp_Flags_*
  2631.         );
  2632.     }
  2633.  
  2634.  
  2635.     //---------------------------------------------------------------------
  2636.     // CameraControl Property enum
  2637.     //---------------------------------------------------------------------
  2638.  
  2639.     typedef enum tagCameraControlProperty
  2640.     {
  2641.         CameraControl_Pan,
  2642.         CameraControl_Tilt,
  2643.         CameraControl_Roll,
  2644.         CameraControl_Zoom,
  2645.         CameraControl_Exposure,
  2646.         CameraControl_Iris,
  2647.         CameraControl_Focus
  2648.     } CameraControlProperty;
  2649.  
  2650.     //---------------------------------------------------------------------
  2651.     // CameraControl Flags enum
  2652.     //---------------------------------------------------------------------
  2653.  
  2654.     typedef enum tagCameraControlFlags
  2655.     {
  2656.         CameraControl_Flags_Auto     = 0x0001,
  2657.         CameraControl_Flags_Manual   = 0x0002
  2658.     } CameraControlFlags;
  2659.  
  2660.     //---------------------------------------------------------------------
  2661.     // IAMCameraControl interface
  2662.     //
  2663.     // Control of local or remote cameras
  2664.     //---------------------------------------------------------------------
  2665.  
  2666.     [
  2667.     object,
  2668.         uuid(C6E13370-30AC-11d0-A18C-00A0C9118956),
  2669.     pointer_default(unique)
  2670.     ]
  2671.     interface IAMCameraControl : IUnknown
  2672.     {
  2673.         // Returns min, max, step size, and default values
  2674.         HRESULT GetRange(
  2675.             [in] long Property,         // Which property to query
  2676.             [out] long * pMin,          // Range minimum
  2677.             [out] long * pMax,          // Range maxumum
  2678.             [out] long * pSteppingDelta,// Step size
  2679.             [out] long * pDefault,      // Default value
  2680.             [out] long * pCapsFlags     // CamaeraControlFlags
  2681.  
  2682.         );
  2683.  
  2684.         // Set a CameraControl property
  2685.         HRESULT Set(
  2686.             [in]  long Property,        // CameraControlProperty
  2687.             [in]  long lValue,          // Value to set
  2688.             [in]  long Flags            // CameraControl_Flags_*
  2689.  
  2690.         );
  2691.  
  2692.         // Get a CameraControl property
  2693.         HRESULT Get(
  2694.             [in]  long Property,        // CameraControlProperty
  2695.             [out] long * lValue,        // Current value
  2696.             [out] long * Flags          // CameraControl_Flags_*
  2697.         );
  2698.     }
  2699.  
  2700.     //---------------------------------------------------------------------
  2701.     // VideoControl Flags enum
  2702.     //---------------------------------------------------------------------
  2703.  
  2704.     typedef enum tagVideoControlFlags
  2705.     {
  2706.         VideoControlFlag_FlipHorizontal        = 0x0001,
  2707.         VideoControlFlag_FlipVertical          = 0x0002,
  2708.         VideoControlFlag_ExternalTriggerEnable = 0x0004,
  2709.         VideoControlFlag_Trigger               = 0x0008
  2710.  
  2711.     } VideoControlFlags;
  2712.  
  2713.     //---------------------------------------------------------------------
  2714.     // IAMVideoControl interface
  2715.     //
  2716.     // Control of horizontal & vertical flip, external trigger,
  2717.     // and listing available frame rates
  2718.     //---------------------------------------------------------------------
  2719.  
  2720.     [
  2721.     object,
  2722.         uuid(6a2e0670-28e4-11d0-a18c-00a0c9118956),
  2723.     pointer_default(unique)
  2724.     ]
  2725.     interface IAMVideoControl : IUnknown
  2726.     {
  2727.         // What can the underlying hardware do?
  2728.         HRESULT GetCaps(
  2729.             [in]  IPin * pPin,          // the pin to query or control
  2730.             [out] long * pCapsFlags     // VideoControlFlag_*
  2731.  
  2732.         );
  2733.  
  2734.         // Set the mode of operation
  2735.         HRESULT SetMode(
  2736.             [in]  IPin * pPin,          // the pin to query or control
  2737.             [in]  long Mode             // VideoControlFlag_*
  2738.  
  2739.         );
  2740.  
  2741.         // Get the mode of operation
  2742.         HRESULT GetMode(
  2743.             [in]  IPin * pPin,          // the pin to query or control
  2744.             [out] long * Mode           // VideoControlFlag_*
  2745.         );
  2746.  
  2747.         // Get actual frame rate info for USB and 1394
  2748.         // This is only available when streaming
  2749.         HRESULT GetCurrentActualFrameRate(
  2750.             [in]  IPin * pPin,                  // the pin to query or control
  2751.             [out] LONGLONG * ActualFrameRate    // 100 nS units
  2752.         );
  2753.  
  2754.         // Get max available frame rate info for USB and 1394
  2755.         // Returns the max frame rate currently available based on bus bandwidth usage
  2756.         HRESULT GetMaxAvailableFrameRate(
  2757.             [in]  IPin * pPin,          // the pin to query or control
  2758.             [in]  long iIndex,          // 0 to IAMStreamConfig->GetNumberOfCapabilities-1
  2759.             [in]  SIZE Dimensions,      // width and height
  2760.             [out] LONGLONG * MaxAvailableFrameRate  // 100 nS units
  2761.         );
  2762.  
  2763.         // Get List of available frame rates
  2764.         HRESULT GetFrameRateList(
  2765.             [in]  IPin * pPin,           // the pin to query or control
  2766.             [in]  long iIndex,           // 0 to IAMStreamConfig->GetNumberOfCapabilities-1
  2767.             [in]  SIZE Dimensions,       // width and height
  2768.             [out] long * ListSize,       // Number of elements in the list
  2769.             [out] LONGLONG ** FrameRates // Array of framerates in 100 nS units
  2770.                                          // or NULL to just get ListSize
  2771.         );
  2772.  
  2773.     }
  2774.  
  2775.  
  2776.     //---------------------------------------------------------------------
  2777.     // IAMCrossbar interface
  2778.     //
  2779.     // Controls a routing matrix for analog or digital video or audio
  2780.     //---------------------------------------------------------------------
  2781.  
  2782.     [
  2783.     object,
  2784.         uuid(C6E13380-30AC-11d0-A18C-00A0C9118956),
  2785.     pointer_default(unique)
  2786.     ]
  2787.     interface IAMCrossbar : IUnknown
  2788.     {
  2789.  
  2790.         // How many pins are there?
  2791.         HRESULT get_PinCounts(
  2792.                 [out] long * OutputPinCount,        // count of output pins
  2793.                 [out] long * InputPinCount);        // count of input pins
  2794.  
  2795.         // True if routing is possible
  2796.         HRESULT CanRoute (
  2797.                 [in]  long OutputPinIndex,          // the output pin
  2798.                 [in]  long InputPinIndex);          // the input pin
  2799.  
  2800.         // Routes an input pin to an output pin
  2801.         HRESULT Route (
  2802.                 [in]  long OutputPinIndex,          // the output pin
  2803.                 [in]  long InputPinIndex);          // the input pin
  2804.  
  2805.         // Returns the input pin connected to a given output pin
  2806.         HRESULT get_IsRoutedTo (
  2807.                 [in]  long OutputPinIndex,          // the output pin
  2808.                 [out] long * InputPinIndex);        // the connected input pin
  2809.  
  2810.         // Returns a pin which is related to a given pin
  2811.         // (ie. this audio pin is related to a video pin)
  2812.         HRESULT get_CrossbarPinInfo (
  2813.                 [in] BOOL IsInputPin,               // TRUE for input pins
  2814.                 [in] long PinIndex,                 // a pin
  2815.                 [out] long * PinIndexRelated,       // Index of related pin
  2816.                 [out] long * PhysicalType);         // Physical type of pin
  2817.  
  2818.     }
  2819.  
  2820.  
  2821.     //---------------------------------------------------------------------
  2822.     // IAMTuner interface
  2823.     //
  2824.     // base tuner device
  2825.     //---------------------------------------------------------------------
  2826.     
  2827.     // predefined subchannel values
  2828.     typedef enum tagAMTunerSubChannel
  2829.     {
  2830.         AMTUNER_SUBCHAN_NO_TUNE     = -2,   // don't tune
  2831.         AMTUNER_SUBCHAN_DEFAULT     = -1    // use default sub chan
  2832.     } AMTunerSubChannel;
  2833.     
  2834.     // predefined signal strength values
  2835.     typedef enum tagAMTunerSignalStrength
  2836.     {
  2837.         AMTUNER_HASNOSIGNALSTRENGTH = -1,   // cannot indicate signal strength
  2838.         AMTUNER_NOSIGNAL            = 0,    // no signal available
  2839.         AMTUNER_SIGNALPRESENT       = 1     // signal present
  2840.     } AMTunerSignalStrength;
  2841.  
  2842.     // specifies the mode of operation of the tuner    
  2843.     typedef enum tagAMTunerModeType
  2844.     {
  2845.         AMTUNER_MODE_DEFAULT    = 0x0000,   // default tuner mode
  2846.         AMTUNER_MODE_TV         = 0x0001,   // tv
  2847.         AMTUNER_MODE_FM_RADIO   = 0x0002,   // fm radio
  2848.         AMTUNER_MODE_AM_RADIO   = 0x0004,   // am radio
  2849.         AMTUNER_MODE_DSS        = 0x0008,   // dss
  2850.     } AMTunerModeType;
  2851.     
  2852.     // Events reported by IAMTunerNotification
  2853.     typedef enum tagAMTunerEventType{
  2854.         AMTUNER_EVENT_CHANGED   = 0x0001,   // status changed
  2855.     } AMTunerEventType;
  2856.     
  2857.     interface IAMTunerNotification;
  2858.  
  2859.     [
  2860.         object,
  2861.         uuid(211A8761-03AC-11d1-8D13-00AA00BD8339),
  2862.         pointer_default(unique)
  2863.     ]
  2864.     interface IAMTuner : IUnknown
  2865.     {
  2866.         // Sets and gets the Channel
  2867.         HRESULT put_Channel(
  2868.             [in] long lChannel,
  2869.             [in] long lVideoSubChannel,
  2870.             [in] long lAudioSubChannel
  2871.             );
  2872.         HRESULT get_Channel(
  2873.             [out] long *plChannel,
  2874.             [out] long *plVideoSubChannel,
  2875.             [out] long *plAudioSubChannel
  2876.             );
  2877.     
  2878.         // Gets the minimum and maximum channel available
  2879.         HRESULT ChannelMinMax(
  2880.             [out] long *lChannelMin,
  2881.             [out] long *lChannelMax
  2882.             );
  2883.     
  2884.         // CountryCode is the same as the international
  2885.         // long distance telephone dialing prefix
  2886.         
  2887.         HRESULT put_CountryCode(
  2888.             [in] long lCountryCode
  2889.             );
  2890.         HRESULT get_CountryCode(
  2891.             [out] long *plCountryCode
  2892.             );
  2893.     
  2894.         HRESULT put_TuningSpace(
  2895.             [in] long lTuningSpace
  2896.             );
  2897.         HRESULT get_TuningSpace(
  2898.             [out] long *plTuningSpace
  2899.             );
  2900.     
  2901.         [local] HRESULT Logon(
  2902.             [in] HANDLE hCurrentUser
  2903.             );
  2904.         HRESULT Logout();
  2905.     
  2906.         // Signal status for current channel
  2907.         // signal strength == TUNER_NOSIGNAL, or strength value
  2908.         HRESULT SignalPresent(
  2909.             [out] long * plSignalStrength    // AMTunerSignalStrength
  2910.             );
  2911.     
  2912.         // allow multifunction tuner to be switch between modes
  2913.         HRESULT put_Mode(
  2914.             [in] AMTunerModeType lMode        // AMTunerModeType
  2915.             );
  2916.         HRESULT get_Mode(
  2917.             [out] AMTunerModeType *plMode    // AMTunerModeType
  2918.             );
  2919.     
  2920.         // retrieve a bitmask of the possible modes
  2921.         HRESULT GetAvailableModes(
  2922.             [out] long *plModes                // AMTunerModeType
  2923.             );
  2924.     
  2925.         // allow IAMTuner clients to receive event notification
  2926.         HRESULT RegisterNotificationCallBack(
  2927.             [in] IAMTunerNotification *pNotify,
  2928.             [in] long lEvents       // bitmask from AMTunerEventType enumeration
  2929.             );
  2930.         HRESULT UnRegisterNotificationCallBack(
  2931.                         [in] IAMTunerNotification *pNotify
  2932.             );
  2933.     }
  2934.     
  2935.     //---------------------------------------------------------------------
  2936.     // IAMTunerNotification interface
  2937.     //
  2938.     // Provided to IAMTuner if notification callbacks are desired
  2939.     //---------------------------------------------------------------------
  2940.     
  2941.     [
  2942.         object,
  2943.         uuid(211A8760-03AC-11d1-8D13-00AA00BD8339),
  2944.         pointer_default(unique)
  2945.     ]
  2946.     interface IAMTunerNotification : IUnknown
  2947.     {
  2948.         HRESULT OnEvent([in] AMTunerEventType Event);
  2949.     }
  2950.     
  2951.     
  2952.     //---------------------------------------------------------------------
  2953.     // IAMTVTuner interface
  2954.     //
  2955.     // Controls an analog TV tuner device
  2956.     //---------------------------------------------------------------------
  2957.  
  2958.     [
  2959.         object,
  2960.         uuid(211A8766-03AC-11d1-8D13-00AA00BD8339),
  2961.         pointer_default(unique)
  2962.     ]
  2963.     interface IAMTVTuner : IAMTuner
  2964.     {
  2965.         // Gets the supported analog video standards (NTSC/M, PAL/B, SECAM/K1, ...
  2966.         HRESULT get_AvailableTVFormats(
  2967.             [out] long *lAnalogVideoStandard
  2968.             );
  2969.     
  2970.         // Gets the current analog video standard (NTSC/M, PAL/B, SECAM/K1, ...)
  2971.         HRESULT get_TVFormat(
  2972.             [out] long * plAnalogVideoStandard
  2973.             );
  2974.     
  2975.         // Scans for a signal on a given channel
  2976.         // NOTE: this is equivalent to put_Channel(), SignalStrength()
  2977.         HRESULT AutoTune(
  2978.             [in] long lChannel,
  2979.             [out] long * plFoundSignal
  2980.             );
  2981.     
  2982.         // Saves the fine tuning information for all channels")]
  2983.         HRESULT StoreAutoTune();
  2984.     
  2985.         // The number of TV sources plugged into the tuner
  2986.         HRESULT get_NumInputConnections(
  2987.             [out] long * plNumInputConnections
  2988.             );
  2989.     
  2990.         // Sets or gets the tuner input type (Cable or Antenna)
  2991.         HRESULT put_InputType(
  2992.             [in] long lIndex,
  2993.             [in] TunerInputType InputType
  2994.             );
  2995.         HRESULT get_InputType(
  2996.             [in] long lIndex,
  2997.             [out] TunerInputType * pInputType
  2998.             );
  2999.     
  3000.         // Sets or gets the tuner input
  3001.         HRESULT put_ConnectInput(
  3002.             [in] long lIndex
  3003.             );
  3004.         HRESULT get_ConnectInput(
  3005.             [out] long *plIndex
  3006.             );
  3007.     
  3008.         // Gets the video and audio carrier frequencies
  3009.         HRESULT get_VideoFrequency(
  3010.             [out] long *lFreq
  3011.             );
  3012.         HRESULT get_AudioFrequency(
  3013.             [out] long *lFreq
  3014.             );
  3015.     }
  3016.  
  3017.     
  3018.     //---------------------------------------------------------------------
  3019.     // IBPCSatelliteTuner interface
  3020.     //
  3021.     // An interface supporting Satellite tuning-related functions
  3022.     //---------------------------------------------------------------------
  3023.     [
  3024.         object,
  3025.         local,
  3026.         uuid(211A8765-03AC-11d1-8D13-00AA00BD8339),
  3027.         pointer_default(unique)
  3028.     ]
  3029.     interface IBPCSatelliteTuner : IAMTuner
  3030.     {
  3031.         HRESULT get_DefaultSubChannelTypes(
  3032.             [out] long *plDefaultVideoType, // Provider-specific service type
  3033.             [out] long *plDefaultAudioType  // Provider-specific service type
  3034.             );
  3035.     
  3036.         HRESULT put_DefaultSubChannelTypes(
  3037.             [in] long lDefaultVideoType,    // Provider-specific service type
  3038.             [in] long lDefaultAudioType     // Provider-specific service type
  3039.             );
  3040.     
  3041.         HRESULT IsTapingPermitted();        // S_OK yes, S_FALSE no
  3042.     }
  3043.  
  3044.  
  3045.  
  3046.     //---------------------------------------------------------------------
  3047.     // IAMTVAudio interface
  3048.     //
  3049.     // TV Audio control
  3050.     //---------------------------------------------------------------------
  3051.     
  3052.     typedef enum tagTVAudioMode
  3053.     {
  3054.         AMTVAUDIO_MODE_MONO            = 0x0001,       // Mono                   
  3055.         AMTVAUDIO_MODE_STEREO       = 0x0002,       // Stereo
  3056.         AMTVAUDIO_MODE_LANG_A       = 0x0010,       // Primary language
  3057.         AMTVAUDIO_MODE_LANG_B       = 0x0020,       // 2nd avail language
  3058.         AMTVAUDIO_MODE_LANG_C       = 0x0040,       // 3rd avail language
  3059.     } TVAudioMode;
  3060.  
  3061.     // Events reported by IAMTVAudioNotification
  3062.     typedef enum tagAMTVAudioEventType
  3063.     {
  3064.         AMTVAUDIO_EVENT_CHANGED     = 0x0001,       // mode changed
  3065.     } AMTVAudioEventType;
  3066.  
  3067.     interface IAMTVAudioNotification;
  3068.  
  3069.     [
  3070.         object,
  3071.         local,
  3072.         uuid(83EC1C30-23D1-11d1-99E6-00A0C9560266),
  3073.         pointer_default(unique)
  3074.     ]
  3075.     interface IAMTVAudio : IUnknown
  3076.     {
  3077.         // retrieve a bitmask of the formats available in the hardware
  3078.         HRESULT GetHardwareSupportedTVAudioModes(
  3079.             [out] long *plModes                // TVAudioMode
  3080.             );
  3081.             
  3082.         // retrieve a bitmask of the possible modes
  3083.         HRESULT GetAvailableTVAudioModes(
  3084.             [out] long *plModes                // TVAudioMode
  3085.             );
  3086.             
  3087.         HRESULT get_TVAudioMode(
  3088.             [out] long *plMode              // TVAudioMode
  3089.             );
  3090.         HRESULT put_TVAudioMode(
  3091.             [in] long lMode                    // TVAudioMode
  3092.             );
  3093.  
  3094.         // allow IAMTVAudio clients to receive event notification
  3095.         HRESULT RegisterNotificationCallBack(
  3096.             [in] IAMTunerNotification *pNotify,
  3097.             [in] long lEvents       // bitmask from AMTVAudioEventType enumeration
  3098.             );
  3099.         HRESULT UnRegisterNotificationCallBack(
  3100.             IAMTunerNotification *pNotify
  3101.             );
  3102.     }
  3103.  
  3104.     //---------------------------------------------------------------------
  3105.     // IAMTVAudioNotification interface
  3106.     //
  3107.     // Provided to IAMTVAudio clients if notification callbacks are desired
  3108.     //---------------------------------------------------------------------
  3109.     
  3110.     [
  3111.         object,
  3112.         local,
  3113.         uuid(83EC1C33-23D1-11d1-99E6-00A0C9560266),
  3114.         pointer_default(unique)
  3115.     ]
  3116.     interface IAMTVAudioNotification : IUnknown
  3117.     {
  3118.         HRESULT OnEvent([in] AMTVAudioEventType Event);
  3119.     }
  3120.  
  3121.  
  3122.  
  3123.  
  3124.     //---------------------------------------------------------------------
  3125.     // IAMAnalogVideoEncoder interface
  3126.     //---------------------------------------------------------------------
  3127.  
  3128.     [
  3129.    object,
  3130.         uuid(C6E133B0-30AC-11d0-A18C-00A0C9118956),
  3131.     pointer_default(unique)
  3132.     ]
  3133.     interface IAMAnalogVideoEncoder : IUnknown
  3134.     {
  3135.         // Gets the supported analog video standards (NTSC/M, PAL/B, SECAM/K1, ...)
  3136.         HRESULT get_AvailableTVFormats(
  3137.                     [out] long *lAnalogVideoStandard
  3138.                     );
  3139.  
  3140.         // Sets or gets the current analog video standard (NTSC/M, PAL/B, SECAM/K1, ...)
  3141.         HRESULT put_TVFormat(
  3142.                     [in] long lAnalogVideoStandard
  3143.                     );
  3144.  
  3145.         HRESULT get_TVFormat(
  3146.                     [out] long * plAnalogVideoStandard
  3147.                     );
  3148.  
  3149.         // Sets or gets the copy protection
  3150.         HRESULT put_CopyProtection (
  3151.                     [in]  long lVideoCopyProtection); // VideoCopyProtectionType
  3152.  
  3153.         HRESULT get_CopyProtection (
  3154.                     [out] long *lVideoCopyProtection); // VideoCopyProtectionType
  3155.  
  3156.  
  3157.         // Enables and disables close captioning
  3158.         HRESULT put_CCEnable (
  3159.                     [in] long lCCEnable);
  3160.  
  3161.         HRESULT get_CCEnable (
  3162.                     [out] long *lCCEnable);
  3163.  
  3164.     }
  3165.  
  3166.     // used by IKsPropertySet set AMPROPSETID_Pin
  3167.     typedef enum {
  3168.     AMPROPERTY_PIN_CATEGORY,
  3169.         AMPROPERTY_PIN_MEDIUM
  3170.     } AMPROPERTY_PIN;
  3171.  
  3172.     //---------------------------------------------------------------------
  3173.     // IKsPropertySet interface
  3174.     //
  3175.     // Sets or gets a property identified by a property set GUID and a
  3176.     // property ID.
  3177.     //
  3178.     // Return codes for all 3 methods:
  3179.     //    E_PROP_SET_UNSUPPORTED  the property set is not supported
  3180.     //    E_PROP_ID_UNSUPPORTED   the property ID is not supported
  3181.     //                                for the specified property set
  3182.     //---------------------------------------------------------------------
  3183.  
  3184. cpp_quote("#ifndef _IKsPropertySet_")
  3185. cpp_quote("#define _IKsPropertySet_")
  3186.  
  3187.     //---------------------------------------------------------------------
  3188.     // #defines for IKsPropertySet::QuerySupported return result in pTypeSupport
  3189.     //---------------------------------------------------------------------
  3190.  
  3191. cpp_quote("#define KSPROPERTY_SUPPORT_GET  1")
  3192. cpp_quote("#define KSPROPERTY_SUPPORT_SET  2")
  3193.  
  3194.  
  3195.     [
  3196.     object,
  3197.         uuid(31EFAC30-515C-11d0-A9AA-00AA0061BE93),
  3198.     pointer_default(unique)
  3199.     ]
  3200.     interface IKsPropertySet : IUnknown
  3201.     {
  3202.         [local] HRESULT Set(
  3203.                     [in]    REFGUID     guidPropSet,
  3204.                     [in]    DWORD       dwPropID,
  3205.                     [in, size_is(cbInstanceData)] LPVOID pInstanceData,
  3206.                     [in]    DWORD        cbInstanceData,
  3207.                     [in, size_is(cbPropData)] LPVOID pPropData,
  3208.                     [in]    DWORD        cbPropData);
  3209.  
  3210.         [call_as(Set)] HRESULT RemoteSet(
  3211.                     [in]    REFGUID     guidPropSet,
  3212.                     [in]    DWORD       dwPropID,
  3213.                     [in, size_is(cbInstanceData)] byte * pInstanceData,
  3214.                     [in]    DWORD        cbInstanceData,
  3215.                     [in, size_is(cbPropData)] byte * pPropData,
  3216.                     [in]    DWORD        cbPropData);
  3217.  
  3218.         // To get a property, the caller allocates a buffer which the called
  3219.         // function fills in.  To determine necessary buffer size, call Get with
  3220.         // pPropData=NULL and cbPropData=0.
  3221.         [local] HRESULT Get(
  3222.                     [in]    REFGUID     guidPropSet,
  3223.                     [in]    DWORD       dwPropID,
  3224.                     [in, size_is(cbInstanceData)] LPVOID pInstanceData,
  3225.                     [in]    DWORD        cbInstanceData,
  3226.                     [out, size_is(cbPropData)] LPVOID pPropData,
  3227.                     [in]    DWORD        cbPropData,
  3228.                     [out]   DWORD *        pcbReturned);
  3229.  
  3230.         [call_as(Get)] HRESULT RemoteGet(
  3231.                     [in]    REFGUID     guidPropSet,
  3232.                     [in]    DWORD       dwPropID,
  3233.                     [in, size_is(cbInstanceData)] byte * pInstanceData,
  3234.                     [in]    DWORD        cbInstanceData,
  3235.                     [out, size_is(cbPropData)] byte * pPropData,
  3236.                     [in]    DWORD        cbPropData,
  3237.                     [out]   DWORD *        pcbReturned);
  3238.         // QuerySupported must either return E_NOTIMPL or correctly indicate
  3239.         // if getting or setting the property set and property is supported.
  3240.         // S_OK indicates the property set and property ID combination is
  3241.         HRESULT QuerySupported(
  3242.                     [in]    REFGUID     guidPropSet,
  3243.                     [in]    DWORD       dwPropID,
  3244.                     [out]   DWORD       *pTypeSupport);
  3245.     }
  3246. cpp_quote("#endif // _IKsPropertySet_")
  3247.  
  3248. [
  3249. object,
  3250. uuid(6025A880-C0D5-11d0-BD4E-00A0C911CE86),
  3251. pointer_default(unique)
  3252. ]
  3253. interface IMediaPropertyBag : IPropertyBag
  3254. {
  3255.     import "ocidl.idl";
  3256.  
  3257.     typedef IMediaPropertyBag *LPMEDIAPROPERTYBAG;
  3258.  
  3259.     // return the i'th element in the property bag
  3260.     HRESULT EnumProperty(
  3261.         [in]  ULONG iProperty,
  3262.         [in, out] VARIANT * pvarPropertyName,
  3263.         [in, out] VARIANT * pvarPropertyValue
  3264.         );
  3265.  
  3266. }
  3267.  
  3268.  
  3269. [
  3270. object,
  3271. uuid(5738E040-B67F-11d0-BD4D-00A0C911CE86),
  3272. pointer_default(unique)
  3273. ]
  3274. interface IPersistMediaPropertyBag : IPersist
  3275. {
  3276.     import "ocidl.idl";
  3277.     import "unknwn.idl";
  3278.  
  3279.     HRESULT InitNew(
  3280.         void
  3281.         );
  3282.  
  3283.     HRESULT Load(
  3284.         [in] IMediaPropertyBag * pPropBag,
  3285.         [in] IErrorLog * pErrorLog
  3286.         );
  3287.  
  3288.     HRESULT Save(
  3289.         [in] IMediaPropertyBag * pPropBag,
  3290.         [in] BOOL fClearDirty,
  3291.         [in] BOOL fSaveAllProperties
  3292.         );
  3293.  
  3294.  
  3295.     typedef IPersistMediaPropertyBag * LPPERSISTMEDIAPROPERTYBAG;
  3296. }
  3297.  
  3298.  
  3299.    //---------------------------------------------------------------------
  3300.    //
  3301.    // Defines IAMPhysicalPinInfo Interface
  3302.    //
  3303.    // Returns an enum and string that describes an input pin's physical type.
  3304.    //
  3305.    // Implement if: you have physical input pins such as video or audio (like
  3306.    // on a video capture card or a VCR)
  3307.    //
  3308.    // Use if: you want to communicate to a user available physical input pins
  3309.    // and allow them to select the active one if there is more than one
  3310.    //---------------------------------------------------------------------
  3311.  
  3312.  
  3313. [
  3314.     object,
  3315.      uuid(F938C991-3029-11cf-8C44-00AA006B6814),
  3316.      pointer_default(unique)
  3317.  ]
  3318. interface IAMPhysicalPinInfo : IUnknown {
  3319.  
  3320.     // Returns VFW_E_NO_ACCEPTABLE_TYPES if not a physical pin
  3321.     HRESULT GetPhysicalType(
  3322.         [out] long *pType,            // the enum representing the Physical Type
  3323.         [out] LPOLESTR *ppszType        // a friendly name
  3324.     );
  3325. }
  3326. typedef IAMPhysicalPinInfo *PAMPHYSICALPININFO;
  3327.  
  3328.    //---------------------------------------------------------------------
  3329.    // Defines IAMExtDevice Interface
  3330.    //
  3331.    // Base interface for external professional devices
  3332.    //
  3333.    // Implement if: the filter controls an external device such as a VCR,
  3334.    // timecode reader/generator, etc.  The intent is to build a object from
  3335.    // this implementation plus another that specifically describes the device,
  3336.    // such as IAMExtTransport.
  3337.    //
  3338.    // Use if: you want to control and external device such as a VCR
  3339.    //
  3340.    // See edevdefs.h for the enumerated parameter list
  3341.    //---------------------------------------------------------------------
  3342.  [
  3343.     object,
  3344.      uuid(B5730A90-1A2C-11cf-8C23-00AA006B6814),
  3345.     pointer_default(unique)
  3346.  ]
  3347.  interface IAMExtDevice : IUnknown
  3348.  {
  3349.     // General device capabilities property.  See edevdefs.h for supported
  3350.     // values
  3351.     HRESULT GetCapability(
  3352.          [in] long Capability,        // identify the property
  3353.         [out] long *pValue,            // return value
  3354.         [out] double *pdblValue        // return value
  3355.      );
  3356.  
  3357.     // Get external device identification string.  Usually the model #
  3358.     // of the device
  3359.     HRESULT get_ExternalDeviceID(
  3360.         [out] LPOLESTR *ppszData        // ID string
  3361.     );
  3362.     
  3363.     HRESULT get_ExternalDeviceVersion(
  3364.         [out] LPOLESTR *ppszData        // revision string
  3365.     );
  3366.     
  3367.     // Controls the external device's power mode
  3368.     HRESULT put_DevicePower([in] long PowerMode
  3369.     );
  3370.     HRESULT get_DevicePower([out] long *pPowerMode
  3371.     );
  3372.     
  3373.     // Some devices need to be reset in some way, i.e., rewinding a VCR
  3374.     // to the beginning of the tape and resetting the counter to zero.
  3375.     HRESULT Calibrate(
  3376.         [in] HEVENT hEvent,
  3377.         [in] long Mode,
  3378.         [out] long *pStatus        // OATRUE is active, OAFALSE is inactive
  3379.     );
  3380.  
  3381.     // Selects the device's communications port, i.e.,COM1, IEEE1394, etc.
  3382.     // See edevdefs.h for enums
  3383.     HRESULT put_DevicePort([in] long DevicePort
  3384.     );
  3385.     HRESULT get_DevicePort([out] long *pDevicePort
  3386.     );
  3387.     
  3388. }
  3389. typedef IAMExtDevice *PEXTDEVICE;
  3390.  
  3391.    //---------------------------------------------------------------------
  3392.    // Defines IAMExtTransport Interface
  3393.    //
  3394.    // Contains properties and methods that control behavior of an external
  3395.    // transport device such as a VTR
  3396.    //
  3397.    // Implement if: you control such a device.  Intended to be agregated
  3398.    // with IAMExtDevice.
  3399.    //
  3400.    // Use if: you want to control such a device
  3401.    //
  3402.    // See edevdefs.h for the parameter lists
  3403.    //---------------------------------------------------------------------
  3404. [
  3405.     object,
  3406.      uuid(A03CD5F0-3045-11cf-8C44-00AA006B6814),
  3407.      pointer_default(unique)
  3408.  ]
  3409. interface IAMExtTransport : IUnknown {
  3410.  
  3411.     // General transport capabilities property.  See edevdefs.h for enums
  3412.     HRESULT GetCapability(
  3413.          [in] long Capability,        // identify the property
  3414.         [out] long *pValue,            // return value
  3415.         [out] double *pdblValue        // return value
  3416.      );
  3417.  
  3418.     // For disc-based devices: spinning, or not spinning.
  3419.     // For tape-based device: threaded, unthreaded or ejected
  3420.     HRESULT put_MediaState([in] long State
  3421.     );
  3422.     HRESULT get_MediaState([out] long *pState    // see edevdefs.h
  3423.     );
  3424.         
  3425.     // Determines state of unit's front panel
  3426.     HRESULT put_LocalControl([in] long State
  3427.     );
  3428.     HRESULT get_LocalControl([out] long *pState    // OATRUE or OAFALSE
  3429.     );
  3430.     
  3431.     // Transport status such as Play, Stop, etc.  More extensive
  3432.     // than AM states.
  3433.     HRESULT GetStatus(
  3434.         [in] long StatusItem,    // see edevdefs.h
  3435.         [out] long *pValue
  3436.     );
  3437.  
  3438.     // Parameters such as recording speed, servo reference, ballistics, etc.
  3439.     HRESULT GetTransportBasicParameters(
  3440.         [in] long Param,
  3441.         [out] long *pValue,
  3442.         [out] LPOLESTR *ppszData
  3443.     );
  3444.  
  3445.     HRESULT SetTransportBasicParameters(
  3446.         [in] long Param,
  3447.         [in] long Value,
  3448.         [in] LPCOLESTR pszData
  3449.     );
  3450.     
  3451.     // Parameters such as video output mode
  3452.     HRESULT GetTransportVideoParameters(
  3453.         [in] long Param,
  3454.         [out] long *pValue
  3455.     );
  3456.  
  3457.     HRESULT SetTransportVideoParameters(
  3458.         [in] long Param,
  3459.         [in] long Value
  3460.     );
  3461.  
  3462.     // Parameters such as audio channel enable
  3463.     HRESULT GetTransportAudioParameters(
  3464.         [in] long Param,
  3465.         [out] long *pValue
  3466.     );
  3467.  
  3468.     HRESULT SetTransportAudioParameters(
  3469.         [in] long Param,
  3470.         [in] long Value
  3471.     );
  3472.     
  3473.     // Mode is  the movement of the transport, i.e., Play, Stop,
  3474.     // Record, Edit, etc.
  3475.     HRESULT put_Mode([in] long Mode
  3476.     );
  3477.     HRESULT get_Mode([out] long *pMode
  3478.     );
  3479.  
  3480.     // Rate is for variable speed control of the the device.  This
  3481.     // can be linked to IMediaControl::Rate() in the implementation
  3482.     // if desired.
  3483.     HRESULT put_Rate([in] double dblRate
  3484.     );
  3485.     HRESULT get_Rate([out] double *pdblRate
  3486.     );
  3487.  
  3488.     // This is a lengthy method, that is, it is in effect until canceled or complete and
  3489.     // requires housekeeping by the filter.  It puts transport in play mode and maintains
  3490.     // fixed relationship between master time reference and transport position.
  3491.     HRESULT GetChase(
  3492.         [out] long *pEnabled,    // OATRUE | OAFALSE
  3493.         [out] long *pOffset,    // offset in current time format
  3494.         [out] HEVENT *phEvent    // completion notification
  3495.     );
  3496.     HRESULT SetChase(
  3497.         [in] long Enable,        // OATRUE | OAFALSE
  3498.         [in] long Offset,        // offset in current time format
  3499.         [in] HEVENT hEvent        // completion notification
  3500.     );
  3501.  
  3502.     // Also a lengthy method: temporarily change transport speed (for synchronizing).
  3503.     HRESULT GetBump(
  3504.         [out] long *pSpeed,
  3505.         [out] long *pDuration    // in current time format
  3506.     );
  3507.     HRESULT SetBump(
  3508.         [in] long Speed,
  3509.         [in] long Duration    // in current time format
  3510.     );
  3511.     
  3512.     // Enable/Disable transport anti-headclog control.
  3513.     HRESULT get_AntiClogControl([out] long *pEnabled    // OATRUE | OAFALSE
  3514.     );
  3515.     HRESULT put_AntiClogControl([in] long Enable    // OATRUE | OAFALSE
  3516.     );
  3517.     
  3518.     // The following group of properties describes edit events.  An edit event can be a
  3519.     // standard insert or assemble edit or a memorized position called a bookmark.
  3520.     // A NOTE ABOUT EVENTS: as with all lengthy commands, event objects must be created to
  3521.     // signal completion or error.
  3522.  
  3523.     // Intended usage: an edit event is prepared for use by:
  3524.     // 1. Registering an edit property set and getting an EditID
  3525.     // 2. Setting the necessary edit properties
  3526.     // 3. Setting the edit property set active
  3527.  
  3528.     // Please see edevdefs.h for properties and values
  3529.  
  3530.     // The reference clock's advance is the mechanism that puts an edit in motion (see
  3531.     // ED_EDIT_REC_INPOINT).
  3532.     
  3533.     // Property set methods
  3534.     HRESULT GetEditPropertySet(
  3535.         [in] long EditID,
  3536.         [out] long *pState    // ED_SET_ACTIVE | ED_SET_INACTIVE | ED_SET_INVALID
  3537.                             // | ED_SET_EXECUTING
  3538.     );
  3539.  
  3540.     HRESULT SetEditPropertySet(
  3541.         [in, out] long *pEditID,
  3542.         [in] long State        // ED_SET_REGISTER | ED_SET_DELETE | ED_SET_ACTIVE |
  3543.     );                        // ED_SET_INACTIVE
  3544.  
  3545.     // the following properties define an edit event such as a bookmark, seek point, or
  3546.     //  actual edit
  3547.     HRESULT GetEditProperty(
  3548.         [in] long EditID,
  3549.         [in] long Param,
  3550.         [out] long *pValue
  3551.     );
  3552.     HRESULT SetEditProperty(
  3553.         [in] long EditID,
  3554.         [in] long Param,
  3555.         [in] long Value
  3556.     );
  3557.     
  3558.     // Activates a capable transport's edit control (typically used for "on the fly" editing).
  3559.     HRESULT get_EditStart([out] long *pValue    // OATRUE or OAFALSE
  3560.     );
  3561.     HRESULT put_EditStart([in] long Value            // OATRUE or OAFALSE
  3562.     );
  3563. }
  3564. typedef IAMExtTransport *PIAMEXTTRANSPORT;
  3565.  
  3566.    //---------------------------------------------------------------------
  3567.    // Defines IAMTimecodeReader Interface
  3568.    //
  3569.    // Contains properties and methods that define behavior of a
  3570.    // SMPTE/MIDI Timecode Reader.  It is expected that this interface
  3571.    // will be combined (aggregated) with IAMExtTransport to "build" a pro
  3572.    // VCR.
  3573.    //
  3574.    // Implement if: you control such a device
  3575.    //
  3576.    // Use if: you want to control such a device
  3577.    //
  3578.    // See edevdefs.h for the parameter lists
  3579.    //=====================================================================
  3580.  
  3581.  
  3582. // timecode structures
  3583. cpp_quote("#if 0")
  3584. cpp_quote("/* the following is what MIDL knows how to remote */")
  3585. typedef struct tagTIMECODE {
  3586.         WORD    wFrameRate;    // will be replaced by AM defs, but see ED_FORMAT_SMPTE for now
  3587.         WORD    wFrameFract;    // fractional frame.  full scale is always 0x1000
  3588.         DWORD    dwFrames;
  3589. }TIMECODE;
  3590. cpp_quote("#else /* 0 */")
  3591. cpp_quote("#ifndef TIMECODE_DEFINED")
  3592. cpp_quote("#define TIMECODE_DEFINED")
  3593. cpp_quote("typedef union _timecode {")
  3594. cpp_quote("   struct {")
  3595. cpp_quote("     WORD   wFrameRate;")
  3596. cpp_quote("     WORD   wFrameFract;")
  3597. cpp_quote("     DWORD  dwFrames;")
  3598. cpp_quote("     };")
  3599. cpp_quote("   DWORDLONG  qw;")
  3600. cpp_quote("   } TIMECODE;")
  3601. cpp_quote("")
  3602. cpp_quote("#endif /* TIMECODE_DEFINED */")
  3603. cpp_quote("#endif /* 0 */")
  3604.  
  3605. typedef TIMECODE *PTIMECODE;
  3606.  
  3607. typedef struct tagTIMECODE_SAMPLE {
  3608.     LONGLONG    qwTick;        // ActiveMovie 100ns timestamp
  3609.     TIMECODE    timecode;    // timecode
  3610.     DWORD        dwUser;        // timecode user data (aka user bits)
  3611.     DWORD        dwFlags;       // timecode flags - see below
  3612. } TIMECODE_SAMPLE;
  3613. typedef TIMECODE_SAMPLE *PTIMECODE_SAMPLE;
  3614.  
  3615.  
  3616. [
  3617.     object,
  3618.      uuid(9B496CE1-811B-11cf-8C77-00AA006B6814),
  3619.      pointer_default(unique)
  3620. ]
  3621. interface IAMTimecodeReader : IUnknown
  3622. {
  3623.     // Timecode Reader Mode - gets/sets the following properties
  3624.     // ED_TCR_SOURCE - timecode gen (readback), LTC, VITC, or Control Track
  3625.     HRESULT GetTCRMode(
  3626.         [in] long Param,
  3627.         [out] long *pValue);
  3628.     HRESULT SetTCRMode(
  3629.         [in] long Param,
  3630.         [in] long Value);
  3631.     
  3632.     // Select which line of the vertical interval timecode will be read from (if VITC).
  3633.     // To read VITC on specific multiple lines, the caller would make successive calls to
  3634.     // put_VITCLine(), once for each line desired.
  3635.     HRESULT put_VITCLine(
  3636.         [in] long Line );    // valid lines are 11-20, 0 means autoselect,
  3637.                             // hi bit set means add to list of lines (for
  3638.                             // readers that test across multiple lines)
  3639.     HRESULT get_VITCLine(
  3640.         [out] long *pLine ); // hi bit set means multiple lines are used,
  3641.                             // and successive calls will cycle through the
  3642.                             // line numbers (like an enumerator, only simpler)
  3643.  
  3644.     // GetTimecode can be used to obtain the most recent timecode value available in the
  3645.     // stream. The client can use this to monitor the timecode, parse duplicates and
  3646.     // discontinuities. The source filter supplying the timecode or possibly a down stream
  3647.     // filter might want to parse for discontinuities or errors since you have to look at
  3648.     // every sample to do this properly.
  3649.     //
  3650.  
  3651.     HRESULT GetTimecode(
  3652.       [out] PTIMECODE_SAMPLE pTimecodeSample) ;
  3653.  
  3654. }
  3655. typedef IAMTimecodeReader *PIAMTIMECODEREADER;
  3656.  
  3657.    //---------------------------------------------------------------------
  3658.    //=====================================================================
  3659.    // Defines IAMTimecodeGenerator Interface
  3660.    //
  3661.    // Contains properties and methods that define behavior of an external
  3662.    // SMPTE/MIDI Timecode Generator.  It is expected that this interface
  3663.    // will be combined (aggregated) with IAMExtTransport to "build" a pro
  3664.    // VCR.
  3665.    //
  3666.    // Implement if: you control such a device
  3667.    //
  3668.    // Use if: you want to control such a device
  3669.    //
  3670.    // See edevdefs.h for the parameter lists
  3671.     //---------------------------------------------------------------------
  3672. [
  3673.     object,
  3674.      uuid(9B496CE0-811B-11cf-8C77-00AA006B6814),
  3675.      pointer_default(unique)
  3676.  ]
  3677. interface IAMTimecodeGenerator : IUnknown {
  3678.  
  3679.     // Timecode Generator Mode - gets/sets the following properties (see
  3680.     // vcrdefss.h for detailed values):
  3681.     // ED_TCG_TIMECODE_TYPE - LTC, VITC, or MIDI
  3682.     // ED_TCG_FRAMERATE - 24, 25, 30 drop or 30 nondrop
  3683.     // ED_TCG_SYNC_SOURCE - what is driving the bitclock
  3684.     // ED_TCG_REFERENCE_SOURCE - what is driving the count value
  3685.     HRESULT GetTCGMode(
  3686.         [in] long Param,
  3687.         [out] long *pValue);
  3688.  
  3689.     HRESULT SetTCGMode(
  3690.         [in] long Param,
  3691.         [in] long Value);
  3692.  
  3693.     // Select into which line(s) of the vertical interval timecode will be inserted (if VITC).
  3694.     // Hi bit set means add this line to any previously set lines.
  3695.     // To generate VITC on specific multiple lines, the caller would make successive calls to
  3696.     // put_VITCLine(), once for each line desired.
  3697.     HRESULT put_VITCLine(
  3698.         [in] long Line        // valid lines are 11-20, 0 means autoselect(this setting
  3699.     );                        // is for TC readers that decode from multiple lines)
  3700.     HRESULT get_VITCLine(
  3701.         [out] long *pLine
  3702.     );
  3703.  
  3704.     // Sets timecode and/or userbit value.  If generator is running, takes effect
  3705.     // immediately.  If caller wants to set only timecode, set userbit value to -1L (and
  3706.     // same for setting userbits only)
  3707.     //
  3708.  
  3709.     HRESULT SetTimecode(
  3710.       [in] PTIMECODE_SAMPLE pTimecodeSample) ;
  3711.  
  3712.  
  3713.     // GetTimecode can be used to obtain the most recent timecode value available in the
  3714.     // stream. The client can use this to monitor the timecode and verify the generator is
  3715.     // working properly
  3716.     //
  3717.  
  3718.     HRESULT GetTimecode(
  3719.       [out] PTIMECODE_SAMPLE pTimecodeSample) ;
  3720.  
  3721. }
  3722. typedef IAMTimecodeGenerator *PIAMTIMECODEGENERATOR;
  3723.  
  3724.     //---------------------------------------------------------------------
  3725.    // Defines IAMTimecodeDisplay Interface
  3726.    //
  3727.    // Contains properties and methods that define behavior of an external
  3728.    // SMPTE/MIDI Timecode Display device (aka "character generator" for
  3729.    // making "burn-ins" or "window dubs"). It is expected that this interface
  3730.    // will be combined (aggregated) with IAMExtTransport and the timecode
  3731.    // interfaces to "build" a pro VCR.
  3732.    //
  3733.    // Implement if: you control such a device
  3734.    //
  3735.    // Use if: you want to control such a device
  3736.    //
  3737.    // See edevdefs.h for the parameter lists
  3738.     //---------------------------------------------------------------------
  3739. [
  3740.     object,
  3741.      uuid(9B496CE2-811B-11cf-8C77-00AA006B6814),
  3742.      pointer_default(unique)
  3743.  ]
  3744. interface IAMTimecodeDisplay : IUnknown
  3745. {
  3746.     // Enable/disable external device's timecode reader's character generator output.  Some
  3747.     // readers have this feature - this is not intended for rendering inside the PC!
  3748.     HRESULT GetTCDisplayEnable(
  3749.         [out] long *pState);    // OATRUE | OAFALSE
  3750.     HRESULT SetTCDisplayEnable(
  3751.         [in] long State);        // OATRUE | OAFALSE
  3752.                                 // Timecode reader's character generator output
  3753.                                 //  characteristics (size, position, intensity, etc.).
  3754.     HRESULT GetTCDisplay(
  3755.         [in] long Param,
  3756.         [out] long *pValue);
  3757.     HRESULT SetTCDisplay(
  3758.         [in] long Param,
  3759.         [in] long Value);
  3760.  
  3761.     /* Allowable params and values (see edevdefs.h for details):
  3762.         ED_TCD_SOURCE
  3763.             ED_TCR | ED_TCG
  3764.         ED_TCD_SIZE
  3765.             ED_SMALL | ED_MED | ED_LARGE
  3766.         ED_TCD_POSITION
  3767.             ED_TOP | ED_MIDDLE | ED_BOTTOM or'd  with
  3768.             ED_LEFT | ED_CENTER | ED_RIGHT
  3769.         ED_TCD_INTENSITY
  3770.             ED_HIGH | ED_LOW
  3771.         ED_TCD_TRANSPARENCY    // set from 0 to 4, 0 being completely opaque
  3772.         ED_TCD_INVERT        // white on black or black on white
  3773.             OATRUE | OAFALSE
  3774.         ED_TCD_BORDER        // white border for black chars, black border for white letters
  3775.             OATRUE | OAFALSE
  3776.     */
  3777. }
  3778. typedef IAMTimecodeDisplay *PIAMTIMECODEDISPLAY;
  3779.  
  3780.  
  3781. [
  3782.     object,
  3783.     uuid(c6545bf0-e76b-11d0-bd52-00a0c911ce86),
  3784.     pointer_default(unique)
  3785. ]
  3786. interface IAMDevMemoryAllocator : IUnknown
  3787. {
  3788.     HRESULT GetInfo(
  3789.         [out] DWORD *pdwcbTotalFree,
  3790.         [out] DWORD *pdwcbLargestFree,
  3791.         [out] DWORD *pdwcbTotalMemory,
  3792.         [out] DWORD *pdwcbMinimumChunk);
  3793.  
  3794.     HRESULT CheckMemory(
  3795.         [in] const BYTE *pBuffer);
  3796.  
  3797.     HRESULT Alloc(
  3798.         [out] BYTE **ppBuffer,
  3799.         [in, out] DWORD *pdwcbBuffer);
  3800.  
  3801.     HRESULT Free(
  3802.         [in] BYTE *pBuffer);
  3803.  
  3804.     HRESULT GetDevMemoryObject(
  3805.         [out] IUnknown **ppUnkInnner,
  3806.         [in] IUnknown *pUnkOuter);
  3807. }
  3808. typedef IAMDevMemoryAllocator *PAMDEVMEMORYALLOCATOR;
  3809.  
  3810.  
  3811. [
  3812.     object,
  3813.     uuid(c6545bf1-e76b-11d0-bd52-00a0c911ce86),
  3814.     pointer_default(unique)
  3815. ]
  3816. interface IAMDevMemoryControl : IUnknown
  3817. {
  3818.     HRESULT QueryWriteSync();
  3819.  
  3820.     HRESULT WriteSync();
  3821.  
  3822.     HRESULT GetDevId(
  3823.         [out] DWORD *pdwDevId);
  3824.  
  3825. }
  3826. typedef IAMDevMemoryControl *PAMDEVMEMORYCONTROL;
  3827.  
  3828. //  Flags for IAMStreamSelection::Info
  3829. enum _AMSTREAMSELECTINFOFLAGS {
  3830.     AMSTREAMSELECTINFO_ENABLED   = 0x01,  // Enable - off for disable
  3831.     AMSTREAMSELECTINFO_EXCLUSIVE = 0x02   // Turns off the others in the group
  3832.                                           // when enabling this one
  3833. };
  3834. //  Flags for IAMStreamSelection::Enable
  3835. enum _AMSTREAMSELECTENABLEFLAGS {
  3836.     //  Currently valid values are :
  3837.     //  0 - disable all streams in the group containing this stream
  3838.     //  ..._ENABLE - enable only this stream with in the given group
  3839.     //               and disable all others
  3840.     //  ..._ENABLEALL - send out all streams
  3841.     AMSTREAMSELECTENABLE_ENABLE    = 0x01,  // Enable
  3842.     AMSTREAMSELECTENABLE_ENABLEALL = 0x02   // Enable all streams in the group
  3843.                                             // containing this stream
  3844. };
  3845.  
  3846. //  Control which logical streams are played and find out information about
  3847. //  them
  3848. //  Normally supported by a filter
  3849. [
  3850.     object,
  3851.     uuid(c1960960-17f5-11d1-abe1-00a0c905f375),
  3852.     pointer_default(unique)
  3853. ]
  3854. interface IAMStreamSelect : IUnknown
  3855. {
  3856.     //  Returns total count of streams
  3857.     HRESULT Count(
  3858.         [out] DWORD *pcStreams);      // Count of logical streams
  3859.  
  3860.     //  Return info for a given stream - S_FALSE if iIndex out of range
  3861.     //  The first steam in each group is the default
  3862.     HRESULT Info(
  3863.         [in] long lIndex,              // 0-based index
  3864.         [out] AM_MEDIA_TYPE **ppmt,   // Media type - optional
  3865.                                       // Use DeleteMediaType to free
  3866.         [out] DWORD *pdwFlags,        // flags - optional
  3867.         [out] LCID  *plcid,           // LCID (returns 0 if none) - optional
  3868.         [out] DWORD *pdwGroup,        // Logical group - optional
  3869.         [out] WCHAR **ppszName,       // Name - optional - free with CoTaskMemFree
  3870.                                       // optional
  3871.         [out] IUnknown **ppObject,    // Associated object - optional
  3872.                                       // Object may change if Enable is
  3873.                                       // called on this interface
  3874.                                       // - returns NULL if no associated object
  3875.                                       // Returns pin or filter for DShow
  3876.         [out] IUnknown **ppUnk);      // Stream specific interface
  3877.  
  3878.     //  Enable or disable a given stream
  3879.     HRESULT Enable(
  3880.         [in]  long lIndex,
  3881.         [in]  DWORD dwFlags);
  3882. }
  3883. typedef IAMStreamSelect *PAMSTREAMSELECT;
  3884.  
  3885. enum _AMRESCTL_RESERVEFLAGS
  3886. {
  3887.     AMRESCTL_RESERVEFLAGS_RESERVE     = 0x00,  // Increment reserve count
  3888.     AMRESCTL_RESERVEFLAGS_UNRESERVE   = 0x01   // Decrement reserve count
  3889. };
  3890.  
  3891. //  Reserve resources now so that playback can be subsequently
  3892. //  guaranteed
  3893. //
  3894. //  Normally supported by a filter
  3895. //
  3896. [
  3897.     object,
  3898.     uuid(8389d2d0-77d7-11d1-abe6-00a0c905f375),
  3899.     pointer_default(unique),
  3900.     local
  3901. ]
  3902. interface IAMResourceControl : IUnknown
  3903. {
  3904.     //  The reserve count is incremented/decremented if and only if
  3905.     //  S_OK is returned
  3906.     //  Unreserve once for every Reserve call
  3907.     HRESULT Reserve(
  3908.         [in] DWORD dwFlags,          //  From _AMRESCTL_RESERVEFLAGS enum
  3909.         [in] PVOID pvReserved        //  Must be NULL
  3910.     );
  3911. }
  3912.  
  3913.  
  3914. //  Set clock adjustments - supported by some clocks
  3915. [
  3916.     object,
  3917.     uuid(4d5466b0-a49c-11d1-abe8-00a0c905f375),
  3918.     pointer_default(unique),
  3919.     local
  3920. ]
  3921. interface IAMClockAdjust : IUnknown
  3922. {
  3923.     //  Set the following delta to clock times
  3924.     //  The clock will add adjust its times by the given delta
  3925.     HRESULT SetClockDelta(
  3926.         [in] REFERENCE_TIME rtDelta
  3927.     );
  3928. };
  3929.  
  3930. //  Filter miscellaneous status flags
  3931.  
  3932. enum _AM_FILTER_MISC_FLAGS {
  3933.     AM_FILTER_MISC_FLAGS_IS_RENDERER = 0x00000001, /* Will deliver EC_COMPLETE
  3934.                                                      at end of media */
  3935.     AM_FILTER_MISC_FLAGS_IS_SOURCE   = 0x00000002  /*  Filter sources data */
  3936. };
  3937.  
  3938. [
  3939.     object,
  3940.     uuid(2dd74950-a890-11d1-abe8-00a0c905f375),
  3941.     pointer_default(unique),
  3942.     local
  3943. ]
  3944. interface IAMFilterMiscFlags : IUnknown
  3945. {
  3946.     //  Get miscellaneous property flags
  3947.     ULONG GetMiscFlags(void);
  3948. };
  3949.  
  3950.  
  3951. // Video Image drawing interface
  3952. [
  3953.     object,
  3954.     local,
  3955.     uuid(48efb120-ab49-11d2-aed2-00a0c995e8d5),
  3956.     pointer_default(unique),
  3957. ]
  3958. interface IDrawVideoImage : IUnknown
  3959. {
  3960.     HRESULT DrawVideoImageBegin();
  3961.  
  3962.     HRESULT DrawVideoImageEnd();
  3963.  
  3964.     HRESULT DrawVideoImageDraw(
  3965.         [in] HDC hdc,
  3966.         [in] LPRECT lprcSrc,
  3967.         [in] LPRECT lprcDst
  3968.     );
  3969. }
  3970.  
  3971. //
  3972. // Video Image decimation interface
  3973. //
  3974. // The aim of this interface is to enable a video renderer filter to
  3975. // control the decimation properties of a video decoder connected to
  3976. // the video renderer
  3977. //
  3978. // This interface should only be supported by decoders that are capable of
  3979. // decimating their output image by an arbitary amount.
  3980. //
  3981. //
  3982. [
  3983.     object,
  3984.     local,
  3985.     uuid(2e5ea3e0-e924-11d2-b6da-00a0c995e8df),
  3986.     pointer_default(unique),
  3987. ]
  3988. interface IDecimateVideoImage : IUnknown
  3989. {
  3990.     //
  3991.     // Informs the decoder that it should decimate its output
  3992.     // image to the specified width and height.  If the decoder can
  3993.     // decimate to this size it should return S_OK.
  3994.     // If the decoder can't perform the requested decimation
  3995.     // or wants to stop performing the decimation that it is
  3996.     // currently doing it should return E_FAIL.
  3997.     //
  3998.     HRESULT SetDecimationImageSize(
  3999.         [in] long lWidth,
  4000.         [in] long lHeight);
  4001.  
  4002.     //
  4003.     // Informs the decoder that it should stop decimating its output image
  4004.     // and resume normal output.
  4005.     //
  4006.     HRESULT ResetDecimationImageSize();
  4007. }
  4008.  
  4009. typedef enum _DECIMATION_USAGE {
  4010.     DECIMATION_LEGACY,              // decimate at ovly then video port then crop
  4011.     DECIMATION_USE_DECODER_ONLY,    // decimate image at the decoder only
  4012.     DECIMATION_USE_VIDEOPORT_ONLY,  // decimate at the video port only
  4013.     DECIMATION_USE_OVERLAY_ONLY,    // decimate at the overlay only
  4014.     DECIMATION_DEFAULT              // decimate at decoder then ovly the vide port then crop
  4015. } DECIMATION_USAGE;
  4016.  
  4017. [
  4018.     object,
  4019.     local,
  4020.     uuid(60d32930-13da-11d3-9ec6-c4fcaef5c7be),
  4021.     pointer_default(unique),
  4022. ]
  4023. interface IAMVideoDecimationProperties: IUnknown
  4024. {
  4025.     //
  4026.     // Queries the current usage of the above IDecimateVideoImage
  4027.     // interface.
  4028.     //
  4029.     HRESULT QueryDecimationUsage(
  4030.         [out] DECIMATION_USAGE* lpUsage);       // from DECIMATION_USAGE enum
  4031.  
  4032.     //
  4033.     // Sets the current usage of the above IDecimateVideoImage
  4034.     // interface.
  4035.     //
  4036.     HRESULT SetDecimationUsage(
  4037.         [in] DECIMATION_USAGE Usage);           // from DECIMATION_USAGE enum
  4038. }
  4039.  
  4040. //---------------------------------------------------------------------
  4041. //
  4042. // IVideoFrameStep interface
  4043. //
  4044. //---------------------------------------------------------------------
  4045.  
  4046. [
  4047.     object,
  4048.     uuid(e46a9787-2b71-444d-a4b5-1fab7b708d6a),
  4049.     pointer_default(unique),
  4050. ]
  4051. interface IVideoFrameStep : IUnknown
  4052. {
  4053.     //
  4054.     //  Stop(), Pause(), Run() all cancel Step as does any seeking
  4055.     //  request.
  4056.     //
  4057.     //  The Step() and CancelStep() methods of this interface
  4058.     //  Cancel any previous step.
  4059.     //
  4060.     //  When stepping is complete EC_STEP_COMPLETE is signalled.
  4061.     //
  4062.     //  When the filter graph gets EC_STEP_COMPLETE it automatically
  4063.     //  sets the filter graph into paused state and forwards the
  4064.     //  notification to the application
  4065.     //
  4066.     //  Returns S_OK if stepping initiated.
  4067.     //
  4068.     //  dwFrames
  4069.     //    1 means step 1 frame forward
  4070.     //    0 is invalid
  4071.     //    n (n > 1) means skip n - 1 frames and show the nth
  4072.     //
  4073.     //  pStepObject
  4074.     //    NULL - default step object (filter) picked
  4075.     //    non-NULL - use this object for stepping
  4076.     //
  4077.     HRESULT Step(DWORD dwFrames, [unique] IUnknown *pStepObject);
  4078.  
  4079.     //  Can step?
  4080.     //  Returns S_OK if it can, S_FALSE if it can't or error code.
  4081.     //  bMultiple - if TRUE return whether can step n > 1
  4082.     HRESULT CanStep(long bMultiple, [unique] IUnknown *pStepObject);
  4083.  
  4084.     //  Cancel stepping
  4085.     HRESULT CancelStep();
  4086. }
  4087.  
  4088.  
  4089.  
  4090.  
  4091. //---------------------------------------------------------------------
  4092. //
  4093. // IAMPushSource interface
  4094. //
  4095. // Provides a means for source filters to describe information about the
  4096. // data that they source, such as whether the data is live or not, and
  4097. // what type of clock was used for timestamps. This information may be
  4098. // needed by other clocks in the graph in order to provide accurate
  4099. // synchronization. Also provides a way to specify an offset value for
  4100. // the filter to use when timestamping the streams it sources. Provides
  4101. // support for the IAMLatency interface as well.
  4102. //
  4103. //---------------------------------------------------------------------
  4104.  
  4105. enum _AM_PUSHSOURCE_FLAGS {
  4106.  
  4107.     //
  4108.     // The default assumption is that the data is from a live source,
  4109.     // time stamped with the graph clock, and the source does not
  4110.     // attempt to rate match the data it delivers.
  4111.     // The following flags can be used to override this assumption.
  4112.     //
  4113.  
  4114.     // capability flags
  4115.     AM_PUSHSOURCECAPS_INTERNAL_RM        = 0x00000001,  // source provides internal support for rate matching
  4116.     AM_PUSHSOURCECAPS_NOT_LIVE           = 0x00000002,  // don't treat source data as live
  4117.     AM_PUSHSOURCECAPS_PRIVATE_CLOCK      = 0x00000004,  // source data timestamped with clock not
  4118.                                                         // exposed to the graph
  4119.  
  4120.     // request flags, set by user via SetPushSourceFlags method
  4121.     AM_PUSHSOURCEREQS_USE_STREAM_CLOCK   = 0x00010000   // source was requested to timestamp
  4122.                                                         // using a clock that isn't the graph clock
  4123. };
  4124.  
  4125. //
  4126. // Used to set a source filter to run in a "live" mode.
  4127. //
  4128. [
  4129. object,
  4130.     uuid(F185FE76-E64E-11d2-B76E-00C04FB6BD3D),
  4131.     pointer_default(unique)
  4132. ]
  4133. interface IAMPushSource : IAMLatency
  4134. {
  4135.     // used to discover push source's capabilities.
  4136.     // may be any combination of the AM_PUSHSOURCE_FLAGS flags.
  4137.     HRESULT GetPushSourceFlags (
  4138.         [out] ULONG *pFlags
  4139.     );
  4140.  
  4141.     // used to set request flags for a push source.
  4142.     // may be a combination of the AM_PUSHSOURCE_REQS_xxx flags.
  4143.     HRESULT SetPushSourceFlags (
  4144.         [in]  ULONG Flags
  4145.     );
  4146.  
  4147.     // specify an offset for push source time stamps
  4148.     HRESULT SetStreamOffset (
  4149.         [in]  REFERENCE_TIME  rtOffset
  4150.     );
  4151.  
  4152.     // retrieve the offset this push source is using
  4153.     HRESULT GetStreamOffset (
  4154.         [out] REFERENCE_TIME  *prtOffset
  4155.     );
  4156.  
  4157.     // retrieve the maximum stream offset this push source thinks it can support
  4158.     HRESULT GetMaxStreamOffset (
  4159.         [out] REFERENCE_TIME  *prtMaxOffset
  4160.     );
  4161.  
  4162.     // allows the filter graph to tell a push source the maximum latency allowed on the graph
  4163.     // this allows pins like the video capture preview pin to be more efficient with the amount
  4164.     // of buffering required to support the maximum graph latency
  4165.     HRESULT SetMaxStreamOffset (
  4166.         [in] REFERENCE_TIME  rtMaxOffset
  4167.     );
  4168. };
  4169.  
  4170.  
  4171. // ------------------------------------------------------------------------
  4172. //
  4173. // IAMDeviceRemoval interface
  4174. //
  4175. // Implemented by filters to request and receive WM_DEVICECHANGE
  4176. // notifications
  4177. //
  4178. // ------------------------------------------------------------------------
  4179.  
  4180. [
  4181.         object,
  4182.         uuid(f90a6130-b658-11d2-ae49-0000f8754b99),
  4183.         pointer_default(unique)
  4184. ]
  4185. interface IAMDeviceRemoval : IUnknown
  4186. {
  4187.  
  4188.     HRESULT DeviceInfo(
  4189.         [out] CLSID *pclsidInterfaceClass,
  4190.         [out] WCHAR **pwszSymbolicLink);
  4191.  
  4192.     HRESULT Reassociate();
  4193.  
  4194.     HRESULT Disassociate();
  4195. }
  4196.  
  4197. //
  4198. // for DV
  4199. //
  4200. typedef struct {
  4201.     //for 1st 5/6 DIF seq.
  4202.     DWORD dwDVAAuxSrc;
  4203.     DWORD dwDVAAuxCtl;
  4204.     //for 2nd  5/6 DIF seq.
  4205.     DWORD dwDVAAuxSrc1;
  4206.     DWORD dwDVAAuxCtl1;
  4207.     //for video information
  4208.     DWORD dwDVVAuxSrc;
  4209.     DWORD dwDVVAuxCtl;
  4210.     DWORD dwDVReserved[2];
  4211.  
  4212. } DVINFO, *PDVINFO;
  4213.  
  4214. // ------------------------------------------------------------------------
  4215. //
  4216. // IDVEnc interface
  4217. //
  4218. // Implemented by DV encoder filters to set Encoder format
  4219. //
  4220. // ------------------------------------------------------------------------
  4221. enum _DVENCODERRESOLUTION {            //resolution
  4222.     DVENCODERRESOLUTION_720x480     =   2012,
  4223.     DVENCODERRESOLUTION_360x240     =   2013,
  4224.     DVENCODERRESOLUTION_180x120     =   2014,
  4225.     DVENCODERRESOLUTION_88x60       =   2015
  4226. };
  4227. enum _DVENCODERVIDEOFORMAT {        //PAL/ntsc
  4228.     DVENCODERVIDEOFORMAT_NTSC        =    2000,
  4229.     DVENCODERVIDEOFORMAT_PAL            =    2001
  4230. };
  4231. enum _DVENCODERFORMAT {        // dvsd/dvhd/dvsl
  4232.     DVENCODERFORMAT_DVSD        =    2007,
  4233.     DVENCODERFORMAT_DVHD        =    2008,
  4234.     DVENCODERFORMAT_DVSL        =    2009
  4235. };
  4236. [
  4237.         object,
  4238.         uuid(d18e17a0-aacb-11d0-afb0-00aa00b67a42),
  4239.         pointer_default(unique)
  4240. ]
  4241. interface IDVEnc : IUnknown
  4242. {
  4243.  
  4244.     HRESULT get_IFormatResolution (
  4245.         [out] int *VideoFormat,    //pal or ntsc
  4246.         [out] int *DVFormat,        //dvsd dvhd dvsl
  4247.         [out] int *Resolution,        //720, 360, 180,88
  4248.         [in]  BYTE fDVInfo,        //TRUE: DVINFO structure exist, FALSE: Do not care DVINFO
  4249.         [out] DVINFO *sDVInfo        //NULL if fDVInfo=FALSE,
  4250.     );
  4251.  
  4252.    HRESULT put_IFormatResolution (
  4253.         [in] int VideoFormat,
  4254.         [in] int DVFormat,
  4255.         [in] int Resolution,    
  4256.         [in] BYTE fDVInfo,        //TRUE: DVINFO structure exist, FALSE: Do not care DVINFO
  4257.         [in] DVINFO *sDVInfo        //NULL if fDVInfo=FALSE,
  4258.     );
  4259.  
  4260. }
  4261.  
  4262. // ------------------------------------------------------------------------
  4263. //
  4264. // IDVDec interface
  4265. //
  4266. // Implemented by DV decoder filters to set decoder size
  4267. //
  4268. // ------------------------------------------------------------------------
  4269. enum _DVDECODERRESOLUTION {
  4270.     DVDECODERRESOLUTION_720x480     =   1000,
  4271.     DVDECODERRESOLUTION_360x240     =   1001,
  4272.     DVDECODERRESOLUTION_180x120     =   1002,
  4273.     DVDECODERRESOLUTION_88x60       =   1003
  4274. };
  4275. enum _DVRESOLUTION {
  4276.     DVRESOLUTION_FULL        =    1000,
  4277.     DVRESOLUTION_HALF        =    1001,
  4278.     DVRESOLUTION_QUARTER        =    1002,
  4279.     DVRESOLUTION_DC            =    1003
  4280. };
  4281. [
  4282.         object,
  4283.         uuid(b8e8bd60-0bfe-11d0-af91-00aa00b67a42),
  4284.         pointer_default(unique)
  4285. ]
  4286. interface IIPDVDec : IUnknown
  4287. {
  4288.     HRESULT get_IPDisplay (
  4289.             [out] int *displayPix        // The display pixels arrage
  4290.                  );
  4291.  
  4292.     HRESULT put_IPDisplay (
  4293.              [in] int displayPix            // Change to this display pixel arrage
  4294.                  ) ;
  4295. }
  4296.  
  4297. //------------------------------------------------------------------------
  4298. //
  4299. // IDVRGB219 interface
  4300. //
  4301. // Implemented by both the DV encoder and decoder filters
  4302. // Used for enabling the 219 mode in which the Range of RGB24 either received
  4303. // by the encoder or produced by the decoder becomes (16,16,16)--(235,235,235)
  4304. // instead of (0,0,0)--(255,255,255).
  4305. // The interface's method has no effect in case of any other color space than
  4306. // RGB 24
  4307. //
  4308. //------------------------------------------------------------------------
  4309.  
  4310. [
  4311.         object,
  4312.         uuid(58473A19-2BC8-4663-8012-25F81BABDDD1),
  4313.         pointer_default(unique)
  4314. ]
  4315. interface IDVRGB219 : IUnknown
  4316. {
  4317.     HRESULT SetRGB219 ([in] BOOL bState);   // State = True   Turn 219 mode on else turn it off.
  4318. }
  4319.  
  4320.  
  4321. // ------------------------------------------------------------------------
  4322. //
  4323. // IDVSplitter interface
  4324. //
  4325. // Implemented by DV splitter filters
  4326. //
  4327. // ------------------------------------------------------------------------
  4328. [
  4329.     object,
  4330.     uuid(92a3a302-da7c-4a1f-ba7e-1802bb5d2d02)
  4331. ]
  4332. interface IDVSplitter : IUnknown
  4333. {
  4334.     HRESULT DiscardAlternateVideoFrames(
  4335.             [in] int nDiscard
  4336.                  ) ;
  4337. }
  4338.  
  4339. //  Audio Renderer statistics params for IAMAudioRendererStats interface
  4340. enum _AM_AUDIO_RENDERER_STAT_PARAM {
  4341.     AM_AUDREND_STAT_PARAM_BREAK_COUNT = 1,     // audio breaks
  4342.     AM_AUDREND_STAT_PARAM_SLAVE_MODE,          // current slave mode, see AM_AUDREND_SLAVE_MODEs
  4343.     AM_AUDREND_STAT_PARAM_SILENCE_DUR,         // silence inserted due to gaps (ms)
  4344.     AM_AUDREND_STAT_PARAM_LAST_BUFFER_DUR,     // duration of the last buffer received
  4345.     AM_AUDREND_STAT_PARAM_DISCONTINUITIES,     // discontinuities seen since running
  4346.     AM_AUDREND_STAT_PARAM_SLAVE_RATE,          // what rate are we currently slaving at? S_FALSE if not slaving
  4347.     AM_AUDREND_STAT_PARAM_SLAVE_DROPWRITE_DUR, // for waveOut slaving - data dropped or added to stay in-sync
  4348.                                                //       dwParam1 - dropped duration(ms)
  4349.                                                //       dwParam2 - paused duration(ms)
  4350.     AM_AUDREND_STAT_PARAM_SLAVE_HIGHLOWERROR,  // highest & lowest clock differences seen
  4351.                                                //       dwParam1 - high err
  4352.                                                //       dwParam2 - low err
  4353.     AM_AUDREND_STAT_PARAM_SLAVE_LASTHIGHLOWERROR, // last high and low errs seen
  4354.                                                //       dwParam1 - last high err
  4355.                                                //       dwParam2 - last low err
  4356.     AM_AUDREND_STAT_PARAM_SLAVE_ACCUMERROR,    // error between master/slave clocks
  4357.     AM_AUDREND_STAT_PARAM_BUFFERFULLNESS,      // percent audio buffer fullness
  4358.     AM_AUDREND_STAT_PARAM_JITTER               // input buffer jitter
  4359. };
  4360.  
  4361. //---------------------------------------------------------------------
  4362. //
  4363. // IAMAudioRendererStats interface
  4364. //
  4365. // Interface to get at statistical information that is optionally stored
  4366. // in an audio renderer filter. Supported on the filter interface (although
  4367. // this might be better for ksproxy if we define it as a pin interface?)
  4368. //
  4369. //---------------------------------------------------------------------
  4370.  
  4371. [
  4372. object,
  4373.     uuid(22320CB2-D41A-11d2-BF7C-D7CB9DF0BF93),
  4374.     pointer_default(unique)
  4375. ]
  4376. interface IAMAudioRendererStats : IUnknown
  4377. {
  4378.     // Get value corresponding to the passed in parameter id
  4379.     HRESULT GetStatParam(
  4380.         [in]   DWORD     dwParam,
  4381.         [out]  DWORD     *pdwParam1,
  4382.         [out]  DWORD     *pdwParam2
  4383.     );
  4384. }
  4385.  
  4386. //---------------------------------------------------------------------
  4387. //
  4388. // IAMLatency interface
  4389. //
  4390. // Allows a filter to report the expected latency associated with a data
  4391. // stream flowing from its input to output pin. Supported on output pins.
  4392. //
  4393. //---------------------------------------------------------------------
  4394.  
  4395. [
  4396. object,
  4397.     uuid(62EA93BA-EC62-11d2-B770-00C04FB6BD3D),
  4398.     pointer_default(unique)
  4399. ]
  4400. interface IAMLatency : IUnknown
  4401. {
  4402.     HRESULT GetLatency(
  4403.         [in]   REFERENCE_TIME  *prtLatency
  4404.     );
  4405. }
  4406.  
  4407.  
  4408. enum _AM_INTF_SEARCH_FLAGS {
  4409.     AM_INTF_SEARCH_INPUT_PIN  = 0x00000001,   // search input pins
  4410.     AM_INTF_SEARCH_OUTPUT_PIN = 0x00000002,   // search output pins
  4411.     AM_INTF_SEARCH_FILTER     = 0x00000004    // search filters
  4412. };
  4413.  
  4414. //---------------------------------------------------------------------
  4415. //
  4416. // IAMGraphStreams interface
  4417. //
  4418. // Interface used to control or search over connected streams of data
  4419. // flow within a filter graph.
  4420. //
  4421. //---------------------------------------------------------------------
  4422.  
  4423. [
  4424. object,
  4425.     uuid(632105FA-072E-11d3-8AF9-00C04FB6BD3D),
  4426.     pointer_default(unique)
  4427. ]
  4428. interface IAMGraphStreams : IUnknown
  4429. {
  4430.     // Search upstream from the current pin, for the specified interface.
  4431.     // dwFlags can be any combination of the AM_INTF_SEARCH_FLAGS, and allows
  4432.     // control over what objects to search. A value of 0 means to search all.
  4433.     HRESULT FindUpstreamInterface(
  4434.         [in]                IPin *pPin,
  4435.         [in]                REFIID riid,
  4436.         [out, iid_is(riid)] void **ppvInterface,
  4437.         [in]                DWORD dwFlags );
  4438.  
  4439.     // Enable or disable the graph's setting of a timestamp offset
  4440.     // on push sources.
  4441.     HRESULT SyncUsingStreamOffset( [in] BOOL bUseStreamOffset );
  4442.  
  4443.     // allow an app to set the maximum offset used on push source filters
  4444.     HRESULT SetMaxGraphLatency( [in] REFERENCE_TIME rtMaxGraphLatency );
  4445. }
  4446.  
  4447.  
  4448. //
  4449. // IAMOverlayFX
  4450. //
  4451. // This interface is exposed by the overlay mixer filter and allows
  4452. // an application to apply various "effects" to the overlay surface
  4453. // used by the overlay mixer.
  4454. //
  4455. // The effects that can be applied are described by the AMOVERLAYFX
  4456. // enumeration.
  4457. //
  4458. enum AMOVERLAYFX {
  4459.     // Normal (ie. top down, left to right) video
  4460.     AMOVERFX_NOFX =             0x00000000,
  4461.  
  4462.     // Mirror the overlay across the vertical axis
  4463.     AMOVERFX_MIRRORLEFTRIGHT =  0x00000002,
  4464.  
  4465.      // Mirror the overlay across the horizontal axis
  4466.     AMOVERFX_MIRRORUPDOWN =     0x00000004,
  4467.  
  4468.     // Deinterlace the overlay, if possible
  4469.     AMOVERFX_DEINTERLACE =      0x00000008
  4470. };
  4471.  
  4472. [
  4473. object,
  4474.     uuid(62fae250-7e65-4460-bfc9-6398b322073c),
  4475.     pointer_default(unique)
  4476. ]
  4477. interface IAMOverlayFX : IUnknown
  4478. {
  4479.     // Use this method to determine what overlay effects are currently available
  4480.     // for the overlay surface used by the overlay mixer filter.
  4481.     //
  4482.     HRESULT QueryOverlayFXCaps(
  4483.         [out] DWORD *lpdwOverlayFXCaps
  4484.         );
  4485.  
  4486.     // Use this method to apply a new overlay effect to the overlay surface
  4487.     // used by the overlay mixer filter.  This method can be called while the
  4488.     // filter graph is running, the effect is applied immediately
  4489.     //
  4490.     HRESULT SetOverlayFX(
  4491.         [in] DWORD dwOverlayFX
  4492.         );
  4493.  
  4494.     // Use this method to determine what effect (if any) is currently being
  4495.     // applied to the overlay surface by the overlay mixer filter.
  4496.     //
  4497.     HRESULT GetOverlayFX(
  4498.         [out] DWORD *lpdwOverlayFX
  4499.         );
  4500. }    
  4501.  
  4502.  
  4503.  
  4504. // IAMOpenProgress interface provides information about current progress through
  4505. // a download
  4506.  
  4507. [
  4508. object,
  4509. uuid(8E1C39A1-DE53-11cf-AA63-0080C744528D),
  4510. pointer_default(unique)
  4511. ]
  4512.  
  4513. interface IAMOpenProgress : IUnknown
  4514. {
  4515.     // QueryProgress can be used to query the source filter which supports this interface
  4516.     // for progress information during a renderfile operation.
  4517.     HRESULT QueryProgress(
  4518.           [out] LONGLONG* pllTotal,
  4519.           [out] LONGLONG* pllCurrent
  4520.          );
  4521.  
  4522.     // AbortOperation can be used to request an abort of RenderFile operation
  4523.     // causing it to stop downloading. This methods instructs the exporter of
  4524.     // the IAMOpenProgress interface to hold up their internal abort flag until
  4525.     // further notice.
  4526.     HRESULT AbortOperation(
  4527.         );
  4528. }
  4529.  
  4530.  
  4531. /*++
  4532.     IMpeg2Demultiplexer
  4533.  
  4534.     This interface is implemented by the MPEG-2 Demultiplexer filter,
  4535.     irrespective of program vs. transport stream splitting functionality.
  4536. --*/
  4537. [
  4538.     object,
  4539.     local,
  4540.     uuid (436eee9c-264f-4242-90e1-4e330c107512),
  4541.     pointer_default(unique)
  4542. ]
  4543. interface IMpeg2Demultiplexer : IUnknown
  4544. {
  4545.     /*++
  4546.         ------------------------------------------------------------------------
  4547.         purpose:    Creates an output pin of the specified media type.
  4548.  
  4549.         pMediaType      media type specifier for the new pin
  4550.         pszPinName      pin name; cannot be a duplicate of an existing pin
  4551.         ppIPin          IPin interface pointer to the newly created pin
  4552.     --*/
  4553.     HRESULT
  4554.     CreateOutputPin (
  4555.         [in]    AM_MEDIA_TYPE * pMediaType,
  4556.         [in]    LPWSTR          pszPinName,
  4557.         [out]   IPin **         ppIPin
  4558.         ) ;
  4559.  
  4560.     /*++
  4561.         ------------------------------------------------------------------------
  4562.         purpose:    Updates the media type of the specified output pin.  If no
  4563.                       connection exists, the media type is updated always.  If
  4564.                       the pin is connected, the success/failure of the call will
  4565.                       depend on downstream input pin's accetance/rejection of
  4566.                       the specified media type, and subsequent success/failure
  4567.                       of a reconnect.
  4568.  
  4569.         pszPinName      pin name
  4570.         pMediaType      new media type specifier
  4571.     --*/
  4572.     HRESULT
  4573.     SetOutputPinMediaType (
  4574.         [in]    LPWSTR          pszPinName,
  4575.         [in]    AM_MEDIA_TYPE * pMediaType
  4576.         ) ;
  4577.  
  4578.     /*++
  4579.         ------------------------------------------------------------------------
  4580.         purpose:    Deletes the specified output pin.
  4581.  
  4582.         pszPinName      pin name
  4583.     --*/
  4584.     HRESULT
  4585.     DeleteOutputPin (
  4586.         [in]    LPWSTR  pszPinName
  4587.         ) ;
  4588. } ;
  4589.  
  4590. //---------------------------------------------------------------------
  4591. // IEnumStreamIdMap interface
  4592. //---------------------------------------------------------------------
  4593.  
  4594. cpp_quote("#define MPEG2_PROGRAM_STREAM_MAP                 0x00000000")
  4595. cpp_quote("#define MPEG2_PROGRAM_ELEMENTARY_STREAM          0x00000001")
  4596. cpp_quote("#define MPEG2_PROGRAM_DIRECTORY_PES_PACKET       0x00000002")
  4597. cpp_quote("#define MPEG2_PROGRAM_PACK_HEADER                0x00000003")
  4598. cpp_quote("#define MPEG2_PROGRAM_PES_STREAM                 0x00000004")
  4599. cpp_quote("#define MPEG2_PROGRAM_SYSTEM_HEADER              0x00000005")
  4600.  
  4601. cpp_quote("#define SUBSTREAM_FILTER_VAL_NONE                0x10000000")
  4602.  
  4603. typedef struct {
  4604.     ULONG   stream_id ;                     //  mpeg-2 stream_id
  4605.     DWORD   dwMediaSampleContent ;          //  #define'd above
  4606.     ULONG   ulSubstreamFilterValue ;        //  filtering value
  4607.     int     iDataOffset ;                   //  offset to elementary stream
  4608. } STREAM_ID_MAP ;
  4609.  
  4610. /*++
  4611.     Enumerates the StreamIds mapped on a pin
  4612. --*/
  4613. [
  4614.     object,
  4615.     local,
  4616.     uuid (945C1566-6202-46fc-96C7-D87F289C6534),
  4617.     pointer_default(unique)
  4618. ]
  4619. interface IEnumStreamIdMap : IUnknown
  4620. {
  4621.     HRESULT
  4622.     Next (
  4623.         [in]                            ULONG           cRequest,
  4624.         [in, out, size_is (cRequest)]   STREAM_ID_MAP * pStreamIdMap,
  4625.         [out]                           ULONG *         pcReceived
  4626.         ) ;
  4627.  
  4628.     HRESULT
  4629.     Skip (
  4630.         [in]    ULONG   cRecords
  4631.         ) ;
  4632.  
  4633.     HRESULT
  4634.     Reset (
  4635.         ) ;
  4636.  
  4637.     HRESULT
  4638.     Clone (
  4639.         [out]   IEnumStreamIdMap **  ppIEnumStreamIdMap
  4640.         ) ;
  4641. } ;
  4642.  
  4643. /*++
  4644.     Implemented on the output pin.
  4645.  
  4646.     Provides the ability to map/unmap a stream_id to/from an output pin.
  4647. --*/
  4648. [
  4649.     object,
  4650.     local,
  4651.     uuid (D0E04C47-25B8-4369-925A-362A01D95444),
  4652.     pointer_default(unique)
  4653. ]
  4654. interface IMPEG2StreamIdMap : IUnknown
  4655. {
  4656.     HRESULT
  4657.     MapStreamId (
  4658.         [in]    ULONG   ulStreamId,                 //  mpeg-2 stream_id
  4659.         [in]    DWORD   MediaSampleContent,         //  #define'd above IEnumStreamIdMap
  4660.         [in]    ULONG   ulSubstreamFilterValue,     //  filter value
  4661.         [in]    int     iDataOffset                 //  elementary stream offset
  4662.         ) ;
  4663.  
  4664.     HRESULT
  4665.     UnmapStreamId (
  4666.         [in]    ULONG   culStreamId,                //  number of stream_id's in pulStreamId
  4667.         [in]    ULONG * pulStreamId                 //  array of stream_id's to unmap
  4668.         ) ;
  4669.  
  4670.     HRESULT
  4671.     EnumStreamIdMap (
  4672.         [out]   IEnumStreamIdMap ** ppIEnumStreamIdMap
  4673.         ) ;
  4674. } ;
  4675.  
  4676.  
  4677. //  Register a service provider with the filter graph
  4678. [
  4679.         object,
  4680.         local,
  4681.         uuid(7B3A2F01-0751-48DD-B556-004785171C54),
  4682.         pointer_default(unique)
  4683. ]
  4684. interface IRegisterServiceProvider : IUnknown
  4685. {
  4686.         // registers one service into it's internal table.. Object is refcounted.
  4687.         //   register a NULL value to remove the service
  4688.         HRESULT RegisterService([in] REFGUID guidService, [in] IUnknown *pUnkObject);
  4689. };
  4690.  
  4691.  
  4692.  
  4693. //---------------------------------------------------------------------
  4694. //
  4695. // IAMClockSlave interface
  4696. //
  4697. // When the audio renderer is slaving to a separate graph clock this 
  4698. // interface provides a way for an app to specify how closely in sync 
  4699. // the slaving renderer should try to stay to the graph clock. Note that 
  4700. // using a larger tolerance for a video & audio playback graph will likely 
  4701. // result in looser a/v sync, so it recommended not to change this setting 
  4702. // except under special circumstances. 
  4703. //
  4704. //---------------------------------------------------------------------
  4705.  
  4706. //
  4707. // Used to set/get the error tolerance used by a slaving audio renderer
  4708. //
  4709. [
  4710. object,
  4711.     uuid(9FD52741-176D-4b36-8F51-CA8F933223BE),
  4712.     pointer_default(unique)
  4713. ]
  4714. interface IAMClockSlave : IUnknown
  4715. {
  4716.     // set millisecond value to use for slaving tolerance
  4717.     // the allowed range is 1 to 1000ms
  4718.     HRESULT SetErrorTolerance (
  4719.         [in]  DWORD dwTolerance
  4720.     );
  4721.     
  4722.     // get millisecond value currently being used for slaving tolerance
  4723.     HRESULT GetErrorTolerance (
  4724.         [out]  DWORD *pdwTolerance
  4725.     );
  4726. };
  4727.  
  4728.  
  4729.  
  4730. //---------------------------------------------------------------------
  4731. //
  4732. // IAMGraphBuilderCallback interface
  4733. //
  4734. // Interface which gives the app a chance to configure filters
  4735. // before a connection is attempted.
  4736. //
  4737. // If this interface is supported by the site passed in to the graph
  4738. // via IObjectWithSite::SetSite, the graph will call back with each
  4739. // filter it creates as part of the Render or Connect process. Does
  4740. // not call back for source filters. Filter may be discarded and not
  4741. // used in graph or may be connected and disconnected more than once
  4742. //
  4743. // The callback occurs with the graph lock held, so do not call into
  4744. // the graph again and do not wait on other threads calling into the
  4745. // graph.
  4746. // 
  4747. //---------------------------------------------------------------------
  4748.  
  4749. [
  4750.     object,
  4751.     uuid(4995f511-9ddb-4f12-bd3b-f04611807b79),
  4752.     local,
  4753.     pointer_default(unique)
  4754. ]
  4755. interface IAMGraphBuilderCallback : IUnknown
  4756. {
  4757.     // graph builder selected a filter to create and attempt to
  4758.     // connect. failure indicates filter should be rejected.
  4759.     HRESULT SelectedFilter( 
  4760.         [in] IMoniker *pMon 
  4761.         );
  4762.  
  4763.     // app configures filter during this call. failure indicates
  4764.     // filter should be rejected.
  4765.     HRESULT CreatedFilter( 
  4766.         [in] IBaseFilter *pFil
  4767.         );
  4768. };
  4769.     
  4770. cpp_quote("#ifdef __cplusplus")
  4771. cpp_quote("#ifndef _IAMFilterGraphCallback_")
  4772. cpp_quote("#define _IAMFilterGraphCallback_")
  4773. cpp_quote("// Note: Because this interface was not defined as a proper interface it is")
  4774. cpp_quote("//       supported under C++ only. Methods aren't stdcall.")
  4775. cpp_quote("EXTERN_GUID(IID_IAMFilterGraphCallback,0x56a868fd,0x0ad4,0x11ce,0xb0,0xa3,0x0,0x20,0xaf,0x0b,0xa7,0x70);")
  4776. cpp_quote("interface IAMFilterGraphCallback : public IUnknown")
  4777. cpp_quote("{")
  4778. cpp_quote("    // S_OK means rendering complete, S_FALSE means retry now.")
  4779. cpp_quote("    virtual HRESULT UnableToRender(IPin *pPin) = 0;")
  4780. cpp_quote(" ")
  4781. cpp_quote("};")
  4782. cpp_quote("#endif // _IAMFilterGraphCallback_")
  4783. cpp_quote("#endif")
  4784.  
  4785. //------------------------------------------------------------------------------
  4786. // File: EncAPI.idl
  4787. //
  4788. // Desc: Encoder (and future decoder) interface definitions.
  4789. //
  4790. // Copyright (c) 1992 - 2002, Microsoft Corporation.  All rights reserved.
  4791. //------------------------------------------------------------------------------
  4792.  
  4793. struct CodecAPIEventData
  4794. {
  4795.     GUID guid;
  4796.     DWORD   dataLength;
  4797.     DWORD   reserved[3];
  4798.     // BYTE data[dataLength];
  4799. };
  4800.  
  4801. interface   IStream;                     //  forward declaration
  4802. //
  4803. //  Applications can pass the CODECAPI_VIDEO_ENCODER to IsSupported to test for video encoders
  4804. //  Similarly, the GUIDs for audio encoders, video decoders, audio decoders and muxes can be
  4805. //  used to test for the codec classification
  4806. //
  4807. //  See uuids.h for a more detailed list.
  4808. //
  4809. [
  4810.     object,
  4811.     uuid(901db4c7-31ce-41a2-85dc-8fa0bf41b8da),
  4812.     pointer_default(unique)
  4813. ]
  4814. interface ICodecAPI : IUnknown
  4815. {
  4816.     //
  4817.     // IsSupported():
  4818.     //
  4819.     // Query whether a given parameter is supported.  
  4820.     //
  4821.     HRESULT
  4822.     IsSupported (
  4823.         [in] const GUID *Api
  4824.         );
  4825.  
  4826.     //
  4827.     // IsModifiable
  4828.     //
  4829.     // Query whether a given parameter can be changed given the codec selection
  4830.     // and other parameter selections.  
  4831.     //
  4832.     HRESULT
  4833.     IsModifiable (
  4834.         [in] const GUID *Api
  4835.         );
  4836.  
  4837.     //
  4838.     // GetParameterRange():
  4839.     //
  4840.     // Returns the valid range of values that the parameter supports should
  4841.     // the parameter support a stepped range as opposed to a list of specific
  4842.     // values.  The support is [ValueMin .. ValueMax] by SteppingDelta.
  4843.     //
  4844.     // Ranged variant types must fall into one of the below types.  Each
  4845.     // parameter will, by definition, return a specific type.
  4846.     //
  4847.     // If the range has no stepping delta (any delta will do), the Stepping
  4848.     // delta will be empty (VT_EMPTY).
  4849.     //
  4850.     HRESULT
  4851.     GetParameterRange (
  4852.         [in] const GUID *Api,
  4853.         [out] VARIANT *ValueMin,
  4854.         [out] VARIANT *ValueMax,
  4855.         [out] VARIANT *SteppingDelta
  4856.         );
  4857.  
  4858.     //
  4859.     // GetParameterValues():
  4860.     //
  4861.     // Returns the list of values supported by the given parameter as a
  4862.     // COM allocated array.  The total number of values will be placed in
  4863.     // the ValuesCount parameter and the Values array will contain the 
  4864.     // individual values.  This array must be freed by the caller through
  4865.     // CoTaskMemFree().
  4866.     //
  4867.     HRESULT
  4868.     GetParameterValues (
  4869.         [in] const GUID *Api,
  4870.         [out, size_is(,*ValuesCount)] VARIANT **Values,
  4871.         [out] ULONG *ValuesCount
  4872.         );
  4873.  
  4874.     //
  4875.     // GetDefaultValue():
  4876.     //
  4877.     // Get the default value for a parameter, if one exists.  Otherwise, 
  4878.     // an error will be returned.
  4879.     //
  4880.     HRESULT
  4881.     GetDefaultValue (
  4882.         [in] const GUID *Api,
  4883.         [out] VARIANT *Value
  4884.         );
  4885.  
  4886.     //
  4887.     // GetValue():
  4888.     //
  4889.     // Get the current value of a parameter.
  4890.     //
  4891.     HRESULT
  4892.     GetValue (
  4893.         [in] const GUID *Api,
  4894.         [out] VARIANT *Value
  4895.         );
  4896.  
  4897.     //
  4898.     // SetValue():
  4899.     //
  4900.     // Set the current value of a parameter.
  4901.     //
  4902.     HRESULT
  4903.     SetValue (
  4904.         [in] const GUID *Api,
  4905.         [in] VARIANT *Value
  4906.         );
  4907.  
  4908.     // new methods beyond IEncoderAPI
  4909.  
  4910.     //
  4911.     // RegisterForEvent():
  4912.     //
  4913.     // Enable events to be reported for the given event GUID.  For DShow
  4914.     // events, the event is returned as
  4915.     //      (EC_CODECAPI_EVENT, lParam=userData, lParam2=CodecAPIEventData* Data)
  4916.     // where
  4917.     //      - the CodecAPIEventData is COM allocated memory and must be handled and freed
  4918.     //        by the application using CoTaskMemFree().
  4919.     //      - the userData is the same pointer passed to RegisterForEvent
  4920.     //
  4921.     // Each data block starts with the following structure:
  4922.     //      struct CodecAPIEventData
  4923.     //      {
  4924.     //          GUID guid;
  4925.     //          DWORD dataLength;
  4926.     //          DWORD reserved[3];     // pad to 16 byte alignment
  4927.     //          BYTE data[dataLength]; 
  4928.     //      }
  4929.     // The guid parameter identifies the event. The data associated with the event follows the
  4930.     // structure (represented by the variable length BYTE data[dataLength] array).
  4931.     //
  4932.     // If guid is equal to CODECAPI_CHANGELISTS, then data is an array of GUIDs that changed as
  4933.     // a result of setting the parameter, as follows:
  4934.     //      GUID    changedGuids[ header.dataLength / sizeof(GUID) ]
  4935.     //
  4936.     // The current array is limited, so a driver may send multiple messages if the array size is
  4937.     // exceeded.
  4938.     //
  4939.     HRESULT
  4940.     RegisterForEvent (
  4941.         [in] const GUID *Api,
  4942.         [in] LONG_PTR userData
  4943.         );
  4944.  
  4945.     //
  4946.     // UnregisterForEvent():
  4947.     //
  4948.     // Disable event reporting for the given event GUID.
  4949.     //
  4950.     HRESULT
  4951.     UnregisterForEvent (
  4952.         [in] const GUID *Api
  4953.         );
  4954.  
  4955.     //
  4956.     // SetAllDefaults
  4957.     //
  4958.     HRESULT SetAllDefaults(void);
  4959.  
  4960.     //
  4961.     // Extended SetValue & SetAllDefaults:
  4962.     //
  4963.     // Changes the current value of a parameter and returns back an alteration list
  4964.     //
  4965.     //  The secondary arguments return back a list of other settings
  4966.     //  that changed as a result of the SetValue() call (for UI updates etc)
  4967.     //  The client must free the buffer.
  4968.     //
  4969.     HRESULT
  4970.     SetValueWithNotify (
  4971.         [in] const GUID *Api,
  4972.         [in] VARIANT *Value,
  4973.         [out, size_is(,*ChangedParamCount)] GUID **ChangedParam,
  4974.         [out] ULONG *ChangedParamCount
  4975.         );
  4976.  
  4977.     //
  4978.     // SetAllDefaultsWithNotify
  4979.     //
  4980.     HRESULT SetAllDefaultsWithNotify(
  4981.         [out, size_is(,*ChangedParamCount)] GUID **ChangedParam,
  4982.         [out] ULONG *ChangedParamCount
  4983.         );
  4984.     //
  4985.     //  GetAllSettings
  4986.     //      Load the current settings from a stream
  4987.     //
  4988.     HRESULT GetAllSettings( [in] IStream* );
  4989.  
  4990.     //
  4991.     //  SetAllSettings
  4992.     //      Save the current settings to a stream
  4993.     //
  4994.     HRESULT SetAllSettings( [in] IStream* );
  4995.  
  4996.     //
  4997.     //  SetAllSettingsWithNotify
  4998.     //
  4999.     HRESULT SetAllSettingsWithNotify( IStream*,
  5000.         [out, size_is(,*ChangedParamCount)] GUID **ChangedParam,
  5001.         [out] ULONG *ChangedParamCount );
  5002. }
  5003.  
  5004. [
  5005.         object,
  5006.         local,
  5007.         uuid(a8809222-07bb-48ea-951c-33158100625b),
  5008.         pointer_default(unique)
  5009. ]
  5010. interface IGetCapabilitiesKey : IUnknown
  5011. {
  5012.         HRESULT GetCapabilitiesKey( [out] HKEY* pHKey );
  5013. };
  5014.  
  5015. // -----------------------------------------------------------------------------------------
  5016. // From this point on, this is retained for backwards compatiblity only 
  5017. // Do not use this for future encoders
  5018. // -----------------------------------------------------------------------------------------
  5019. [
  5020.     object,
  5021.     uuid(70423839-6ACC-4b23-B079-21DBF08156A5),
  5022.     pointer_default(unique)
  5023. ]
  5024. interface IEncoderAPI : IUnknown
  5025. {
  5026.     HRESULT IsSupported ( [in] const GUID *Api );
  5027.     HRESULT IsAvailable ( [in] const GUID *Api );
  5028.     HRESULT GetParameterRange ( [in] const GUID *Api,
  5029.         [out] VARIANT *ValueMin, [out] VARIANT *ValueMax,
  5030.         [out] VARIANT *SteppingDelta );
  5031.     HRESULT GetParameterValues ( [in] const GUID *Api,
  5032.         [out, size_is(,*ValuesCount)] VARIANT **Values,
  5033.         [out] ULONG *ValuesCount );
  5034.     HRESULT GetDefaultValue ( [in] const GUID *Api, [out] VARIANT *Value );
  5035.     HRESULT GetValue ( [in] const GUID *Api, [out] VARIANT *Value );
  5036.     HRESULT SetValue ( [in] const GUID *Api, [in] VARIANT *Value );
  5037. }
  5038.  
  5039. [
  5040.     object,
  5041.     uuid(02997C3B-8E1B-460e-9270-545E0DE9563E),
  5042.     pointer_default(unique)
  5043. ]
  5044. interface IVideoEncoder : IEncoderAPI
  5045. {
  5046. }
  5047. //---------------------------------------------------------------------
  5048. //
  5049. // Old Encoder API Interfaces
  5050. //
  5051. //---------------------------------------------------------------------
  5052.  
  5053. cpp_quote ("#ifndef __ENCODER_API_DEFINES__")
  5054. cpp_quote ("#define __ENCODER_API_DEFINES__")
  5055.  
  5056. typedef enum {
  5057.  
  5058.     //
  5059.     // Bit rate used for encoding is constant
  5060.     //
  5061.     ConstantBitRate = 0,
  5062.  
  5063.     //
  5064.     // Bit rate used for encoding is variable with the specified bitrate used
  5065.     // as a guaranteed average over a specified window.  The default window 
  5066.     // size is considered to be 5 minutes.
  5067.     //
  5068.     VariableBitRateAverage,
  5069.  
  5070.     //
  5071.     // Bit rate used for encoding is variable with the specified bitrate used
  5072.     // as a peak rate over a specified window.  The default window size 
  5073.     // is considered to be 500ms (classically one GOP).
  5074.     //
  5075.     VariableBitRatePeak
  5076.  
  5077. } VIDEOENCODER_BITRATE_MODE;
  5078.  
  5079. cpp_quote ("#endif // __ENCODER_API_DEFINES__")
  5080.  
  5081. cpp_quote("#define AM_GETDECODERCAP_QUERY_VMR_SUPPORT   0x00000001")
  5082. cpp_quote("#define      VMR_NOTSUPPORTED                0x00000000")
  5083. cpp_quote("#define      VMR_SUPPORTED                   0x00000001")
  5084.  
  5085. cpp_quote("#define AM_QUERY_DECODER_VMR_SUPPORT         0x00000001")
  5086. cpp_quote("#define AM_QUERY_DECODER_DXVA_1_SUPPORT      0x00000002")
  5087.  
  5088. cpp_quote("#define AM_QUERY_DECODER_DVD_SUPPORT         0x00000003")
  5089. cpp_quote("#define AM_QUERY_DECODER_ATSC_SD_SUPPORT     0x00000004")
  5090. cpp_quote("#define AM_QUERY_DECODER_ATSC_HD_SUPPORT     0x00000005")
  5091. cpp_quote("#define AM_GETDECODERCAP_QUERY_VMR9_SUPPORT  0x00000006")
  5092.  
  5093. cpp_quote("#define      DECODER_CAP_NOTSUPPORTED        0x00000000")
  5094. cpp_quote("#define      DECODER_CAP_SUPPORTED           0x00000001")
  5095.  
  5096. [
  5097.         object,
  5098.         local,
  5099.         uuid(c0dff467-d499-4986-972b-e1d9090fa941),
  5100.         pointer_default(unique)
  5101. ]
  5102. interface IAMDecoderCaps : IUnknown
  5103. {
  5104.         HRESULT GetDecoderCaps([in] DWORD dwCapIndex, [out] DWORD* lpdwCap);
  5105. };
  5106.